开发者

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

开发者 https://www.devze.com 2023-04-10 01:30 出处:网络
Im trying to redirect my website from www.example.com to example.com with the following code but i get 500 error.

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

精彩评论

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

关注公众号