views:

104

answers:

3

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

A: 

If it can help: This is part of trace to www.example.com.

 ...
 10    24 ms    23 ms    24 ms  ae-3.r20.asbnva02.us.bb.gin.ntt.net [129.250.2.1
 11    95 ms   102 ms   100 ms  as-2.r21.lsanca03.us.bb.gin.ntt.net [129.250.5.2
 12    96 ms   103 ms    94 ms  po-2.r00.lsanca19.us.bb.gin.ntt.net [129.250.6.4
 13    89 ms   124 ms    89 ms  204.1.254.150
 14    89 ms    89 ms    84 ms  www.example.com [192.0.32.10]

Trace complete.

RocketSurgeon
This is not a answer
Agusti-N
+1  A: 

I would confirm that IIS has both host headers (rsolberg.com and www.rsolbeg.com) listed for your site. Without the www version requests will make it to the correct web server but IIS won't serve the correct site and may be returning a generic 404 instead. I don't think the redirect/rewrite is involved at all as no 301/302s are getting sent.

INinjaAndy
A: 

I have solved this problem earlier, just delete the earlier CNAME. And try adding a new one as below

www.rsolberg.com CNAME --> rsolberg.com

  • Ananth Ramasamy Meenachi www.msarm.com
Ananth Ramasamy Meenachi
You don't need to include your name and website in your replies - that is what your profile is for.
APC