This question can also be hosted on ServerFault, however there is definitely a coding element associated with the rewrite rules in my web.config. That's why the question actually has a home on SO.
I recently hosted a site on a new server and found that trying to access my site using www.example.com returns 404, while example.com works just fine. I'm not sure if this is a problem with configuring IIS or with the rewrite rules that I specified in web.config .
I did not update the site without the rules shown below to find out if this is really a problem. These rules worked fine while the site was hosted on DiscountASP.NET.
<rewrite> <rules> <rule name="Redirect to NON-WWW" stopProcessing="true"> <match url=".*"/> <conditions> <add input="{HTTP_HOST}" pattern="^www.rsolberg.com$"/> </conditions> <action type="Redirect" url="http://rsolberg.com/{R:0}" redirectType="Permanent"/> </rule> <rule name="Default Document" stopProcessing="true"> <match url="(.*)default.aspx"/> <action type="Redirect" url="{R:1}" redirectType="Permanent"/> </rule> </rules> </rewrite>
I also confirmed to GoDaddy that there is a WWW cname pointing to @.
IN:
http://rsolberg.com
Does not work:
http://www.rsolberg.com
source share