文章内容

2017/9/27 17:45:52,作 者: 黄兵

Web.config URL Rewrites - HTTPS and Non-WWW

I need the URLs to redirect from:

解决方案:

Was my own issue - there was no DNS for the www, therefore the redirect wouldn't resolve on it's own.

Code used:

 <rule name="Redirect to HTTPS" stopProcessing="true">
      <match url="(.*)"/>
      <conditions>
        <add input="{HTTPS}" pattern="^OFF$"/>
      </conditions>
      <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent"/>
    </rule>
    <rule name="Remove WWW" patternSyntax="Wildcard" stopProcessing="true">
      <match url="*" />
      <conditions>
        <add input="{CACHE_URL}" pattern="*://www.*" />
      </conditions>
      <action type="Redirect" url="{C:1}://{C:2}" redirectType="Permanent" />
    </rule>

参考资料:Web.config URL Rewrites - HTTPS and Non-WWW

ERR operation not permitted
Redis 实战
分享到:

发表评论

评论列表