3

So, I have a site with 2 host headers:

header1.example.com
header2.example.com

In this site, I have a virtual directory called Foo and it has various sub-directories 1, 2, 3 & 4 that have various style sheets. A page references these style sheets dynamically via /Foo/1/Style.css and /Foo/2/Style.css.

i.e.

http://header1.example.com/SomePageThatUsesFoo1Style.aspx
http://header1.example.com/SomePageThatUsesFoo2Style.aspx

When I go to http://header1.example.com/SomePageThatUsesFoo2Style.aspx I am getting a 404 trying to get /Foo/2/Style.css.

The file absolutely 100% exists in the correct directory, and permissions are correct.

The interesting part. If I go to http://header1.example.com/SomePageThatUsesFoo1Style.aspx it works just fine. Also, if I go to http://header2.SomePageThatUsesFoo2Style.aspx or http://header2.example.com/SomePageThatUsesFoo1Style.aspx it works just fine.

Has anyone seen this kind of weird issue where 1 specific host header screws things up?

I'll also add that just for giggles, I created a completely NEW website from scratch with a NEW host header (header3.example.com) and everything worked. I stopped the old site, and added header1 and header2 to the new site and the same error occurs.

Note: I tried using Microsoft Network Monitor 3.4 to capture packets. I hit several pages of my site where the above is experienced. Applied a filter to the capture for any HTTP status code >= 400 and there are no results. When using Fiddler from my desktop hitting my site, Fiddler shows a 404 also.

Any thoughts?

masegaloeh
  • 17,978
  • 9
  • 56
  • 104
Adam
  • 205
  • 4
  • 14
  • 1
    I've had the best luck tracking down 404 errors by running a packet capture on the server to watch the actual requests and responses. This has helped me track down weird 404 problems. – joeqwerty Aug 09 '11 at 23:11
  • Can you recommend one? – Adam Aug 10 '11 at 13:50
  • 1
    Microsoft Network Monitor is a good one, and it's free. http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=4865 – joeqwerty Aug 10 '11 at 14:05
  • I downloaded and installed this, captured traffic for a bit, hit my site experiencing the above, and ran the standard httperror filter built in and have no results. Thoughts? – Adam Aug 10 '11 at 14:26
  • 1
    In the capture you should be able to see the actual request that generetaed the 404 and the response. I usually key in on the request to see what exactly is being requested. You should be able to see the actual URL being requested when the 404 is encountered and you can then verify whether the URL is valid or not. Feel free to post a screenshot of the request/response when the 404 is encountered. – joeqwerty Aug 10 '11 at 14:47
  • You should make this the answer. While it isn't directly the answer it has definitely pointed me in the right direction. I couldn't find the request so I started to get confused and decided to look at the DNS entries for header1 and header2. Sure enough they are different. So the whole problem was that the files were returning a 404 because they were being looked for on a different server than where I was told to put them. That also explains why a completely new site with the same host headers didn't work either. Thanks much for your help. – Adam Aug 10 '11 at 15:32
  • Glad you got it figured out. I created an answer from my comments. – joeqwerty Aug 10 '11 at 17:35

1 Answers1

1

I've had the best luck tracking down 404 errors by running a packet capture on the server to watch the actual requests and responses.

In the capture you should be able to see the actual request that generated the 404 and the response. I usually key in on the request to see what exactly is being requested. You should be able to see the actual URL being requested when the 404 is encountered and you can then verify whether the URL is valid or not.

joeqwerty
  • 108,377
  • 6
  • 80
  • 171