开发者

Webconfig redirecting from www.example.com to http://example.com

Im trying to redirect my website from www.example.com to example.com with the following code but i get 500 error.

<system.webServer>
    <rewrite>
      <rules>
        <rule name="Redirect from WWW" stopProcessing="true">
          <match url=".*" />
          <conditions>
            <add input="{HTTP_HOST}" pattern="^www.example.com$" />
          </cond开发者_JAVA百科itions>
          <action type="Redirect" url="http://example.com/{R:0}" redirectType="Permanent" />
       </rule>
     </rules>
   </rewrite>
</system.webServer>

Would you please let me know what is wrong with my code?


Is your DNS server setup to resolve example.com, without the www???

that might be your issue

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜