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
精彩评论