Web Hosting Talk







View Full Version : Custom 404 page not interpreting ASP?


P3TER
11-19-2002, 07:06 AM
Hi, I wonder if anyone can help my host to help me..!

At my previous host, I mapped 404 errors to a directory, and ran an ASP script that emailed me with the Referring URL, Requested Page, etc, then showed a customised 404 error.

I recently moved to a new host, using IIS 5 Win2K servers, FP2002 extensions and Hosting Controller.

On this host, after mapping 404 errors to a folder in my web, the source code of ASP pages are displayed as if they were text files.

After playing around, I found the following: Requesting a non-existing ".ASP" page DOES interpret the ASP in the 404 error page.
Requesting a non-existing ".HTM" page gives the system default "HTTP/1.1 404 Object Not Found" error
Requesting a non-existing ".PHP" page gives "CGI Error The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:"
Requesting a non-existing folder DOES NOT process the ASP in the error page- The page shows as text if it is ASP only, or as HTML if the page contains HTML.Wierd huh!! My host appears to have given up on this one, so I would be grateful if anyone could give any pointers!

regards,

Peter

TDMWeb
11-19-2002, 07:16 AM
Check that the custom error page is set up as a URL (htttp://domain.com/page.asp) not as a file (e:\websites\site001\html\page.asp).

P3TER
11-19-2002, 08:14 AM
Thanks, I have just checked - The behavior is with the error page set to 'URL', with a http address.

When I ask for a nonexistent ASP page e.g.
http://www.mysite.com/nopage.asp

The URL in the address bar changes to "http://www.mysite.com/404/default.asp?404;http://www.mysite.com/nopage.asp", and my ASP code is processed. This is the behavior I remember.

The other errors just stay with the bad URL listed, and the default error message e.g.

http://www.mysite.com/nopage.htm
HTTP/1.1 404 Object Not Found

http://www.mysite.com/nofolder
HTTP/1.1 404 Object Not Found

Any pointers gratefully explored!
/Peter

TDMWeb
11-19-2002, 12:15 PM
For PHP, in IIS for that website, in the application mappings (Home Diry tab, click Configuration in the lower part of the dialog), ensure that for the .php extension the option "Check that file exists" is set -- that should ensure that your custom error page is displayed for a not-found .php file.

As for the .htm/.html page, I was wrong giving you "htttp://domain.com/page.asp" as the format for a URL: it has to be of the form "/domain.com/page.asp" -- in other words the location of the error file relative to the "root" of the virtual directory for that domain (I was doing it from memory not looking -- slapped wrist!).

Wolfy
11-19-2002, 07:49 PM
Given that your 'asp error' pages work with a .asp extension, but not with the other file extensions, I'd try mapping the asp.dll to the other file extensions (.htm and .html at least, mapping .php to asp.dll would not be a good idea) and see what happens. It may well work. :)
(ISM: Website Properties, Home Directory, Configuration, App Mappings).

P3TER
11-20-2002, 02:58 AM
The last 2 suggestions look promising - I did a few searches and came up with this:
http://www.windowswebsolutions.com/Articles/Index.cfm?ArticleID=22278
Which also points at the "Check that file exists" option - I have passed your advice to my host, and will let you know the outcome!

thanks!

Peter

P3TER
12-05-2002, 08:44 AM
I said I would let you know the outcome... well, the problem is almost certainly due to the "check that files exists" problem, however it may be a month or so more before my web host gets around to implementing the solution... I'm still waiting for a response form my last 2 updates to this trouble ticket.

However I also found that moving my error handler script "handler.asp" to the root of my website (it was in a '/404/' subfolder) gets around this problem for all but the .PHP extension.

To you guys that helped - Thanks again.