[英]redirect https://www to https:// through web.config
我想將任何內容重定向到https://domain.com
我找到了這段代碼:
<rewrite>
<rules>
<rule name="SecureRedirect" stopProcessing="true">
<match url="^(.*)$" />
<conditions>
<add input="{HTTPS}" pattern="off" />
<add input="{HTTP_HOST}" pattern="^(www\.)?(.*)$" />
</conditions>
<action type="Redirect" url="https://{C:2}" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
它的工作除了https://www.domain.com
我的虛擬服務器是帶有IIS 8的Windows Server 2012,域名是https://kajsystem.com
我建議使用IIS 8配置,包括使用URL Rewrite模塊,它可以處理轉發並保留整個請求的URL。 MSDN網站上有一篇相當全面的文章,內容如下:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.