This question could be posted on ServerFault as well, however there is definitely a coding element involved due to the rewrite rules in my web.config. This is why the question does indeed have a home on SO.
I've recently deployed a website to a new server and have discovered that trying to access my site via www.example.com
returns a 404 while example.com
works just fine. I'm not sure if this is an IIS configuration issue or with the rewrite rules I've specified in my web.config
.
I have not redployed the site without the rules shown below to see if they are indeed the issue. These rules were working fine while the site was hosted by 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've also confirmed with GoDaddy that there is a WWW cname
pointed to @.
Working:
http://rsolberg.com
Not Working:
http://www.rsolberg.com