tags:

views:

3769

answers:

9

Why when I access an aspx (e.g., http://www.example.com/foo.aspx - not the real site) through IE6 would I get a 404 Error (i.e., "The page cannot be found") in IIS

I've got scripts enabled for the website and I've tried with executables enabled as well.

Here is the full error:

The page cannot be found
The page you are looking for might have been removed, had its name changed, or
is temporarily unavailable. 
------------------------------------------------------------------------------

Please try the following:

Make sure that the Web site address displayed in the address bar of your 
browser is spelled and formatted correctly. 
If you reached this page by clicking a link, contact the Web site 
administrator to alert them that the link is incorrectly formatted. 
Click the Back button to try another link. 
HTTP Error 404 - File or directory not found.
Internet Information Services (IIS)

------------------------------------------------------------------------------

Technical Information (for support personnel)

Go to Microsoft Product Support Services and perform a title search for the 
words HTTP and 404. 
Open IIS Help, which is accessible in IIS Manager (inetmgr), and search for 
topics titled Web Site Setup, Common Administrative Tasks, and About Custom 
Error Messages.

I can get to Default.htm in the same directory, so I know the path is right. I've opened it up to everyone (temporarily) so I know the permissions are right.

A: 

The site is pointing to a different directory where the page is not.

It could be permissions, however I would think you would get an access error instead.

I'm assuming you are running IIS.

Chuck Conway
+3  A: 

Check that the anonymous user under which the site runs has read access to the file foo.aspx.

IIS6 and later uses a 404 response, thereby not letting an attacker know whether such a file even exists.

AnthonyWJones
+1  A: 

There's a number of different reasons this could be, including handler mappings. What web server are you using? What's the sub error code?

Ray
Quite possibly ASP.NET isn't configured correctly (or at all on the server)Also, take a look in the IIS logs, and see what was actually requested on the server.
Zhaph - Ben Duguid
A: 

Check that www.example.com is going to the site that you think it is.

If you are hosting multiple sites on the same IP using host headers you may want to double check the name you are using is going to the site you think it is.

Darryl Braaten
+10  A: 

It could be a lot of things. I had this issue today because .NET had not been re-initialized after installing IIS (aspnet_regiis -i or equivalent).

Joe
That's it... the full path looks like the following: C:\WINDOWS\Microsoft.NET\Framework\v2.0xxxxxx\aspnet_regiis.exe -I (now at least I'm getting a *meaningful* error with my aspx file)
CodeSlave
AND you also have to go into IIS Manager -> Servername -> "Web Service Extensions", and set ASP.NET v2.0xxxxxx to Allowed.
CodeSlave
Just add `-enable` to the end of the aspnet_regiis command to load it as Allowed from the start: `C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe –i -enable`
Kit Roed
A: 

Ray and Joe probably have it. In order to serve any file type, IIS has to have a mapping for it. Aspx files require that they be mapped to the AspNet ISAPI dll, which the .Net installation normally takes care of. If you install IIS after .Net (and I'm sure there are other situations), you have to initiate this yourself by running aspnet_regiis.

Brian
A: 

It's working, thank you very much.

+1  A: 

I just happened to find another culprit for this issue. My foo.aspx page referenced a particular master page that had a <%@ Register %> directive to a user control that did not exist. Removing the reference to the non-existent user control caused my foo.aspx to load instead of 404.

Michael Kropat
A: 

ALTERNATE SOLUTION (same error perhaps different cause).

I had installed Visual Studio 2008 Pro without SQL Express it, and it caused this same error. Reinstallation of VS2008 with sql express included seemed to have corrected the problem, or perhaps the install took other actions. I did try to register ASP.net numerous times prior but no luck however it is definitely the most probable cause Just posting my experience for those pulling their hair as I was..

Thanks

Rick