use*_*794 0 url-rewriting appcmd
我想使用appcmd创建urlrewrite url以重定向来自的所有请求
HTTP://
至
https://开头
我试图谷歌但没有找到.你能给我一些基本的例子吗?
得到它的工作:
appcmd.exe set config -section:system.webServer/rewrite/rules /+"[name='http_redirect',enabled='True']" /commit:apphost
appcmd.exe set config -section:system.webServer/rewrite/rules.[name='http_redirect'] /match.url:"(.*)" /match.ignoreCase:true /commit:apphost
appcmd.exe set config -section:system.webServer/rewrite/rules.[name='http_redirect'].conditions/add /+"[input='{HTTPS}',pattern='off']" /commit:apphost
appcmd.exe set config -section:system.webServer/rewrite/rules.[name='http_redirect'].action /+"[type='Redirect',url='https://{HOST_NAME}/{R:1}',redirectType='Found']" /commit:apphost
Run Code Online (Sandbox Code Playgroud)
此链接可以帮助构建appcmd脚本.
| 归档时间: |
|
| 查看次数: |
3423 次 |
| 最近记录: |