Forum Moderators: open

Message Too Old, No Replies

Error Page Handling Gone Awry

IIS oddity

         

rogerd

6:39 pm on Nov 26, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I have a few sites on windows servers where I've been using a custom error page approach to clean up the URLs for ages. Once configured, it pretty much hums along with no problems. However, after some server changes by the host, I'm seeing odd behavior on a few different sites.

Here's a typical URL setup:

www.example.com/store/brandpage.asp?brand=acme
www.example.com/store/prodpage.asp?product=widget

I set up artificial URLs like these:

www.example.com/myshop/acme/ (for brands)
www.example.com/myshop/acme/widget.htm (for products)

When someone clicks on a link, the page doesn't exist so it gets directed to the custom error page. I parse the error string, and set a few variables, and then use this code:

Response.Status = "200 OK"
server.execute("prodpage.asp")

Everything has worked flawlessly until recent server moves. Now, I get a different condition if the page called is a brand or product page.

"www.example.com/myshop/acme/" brings up the Acme product page just fine, the Server Status is 200, and the www.example.com/myshop/acme/ URL shows in the address bar. All is perfect.

But... "www.example.com/myshop/acme/widget.htm" brings up the correct page (so it's clear the error query string is being parsed correctly and the right variables are being passed), but checking the server headers shows this:

HTTP/1.1 302 Object moved
Server: Microsoft-IIS/5.0
Date: Fri, 26 Nov 2004 18:23:55 GMT
X-Powered-By: ASP.NET
Location: /store/customerror.htm?404;http://www.example.com/myshop/Acme/widget.htm

The URL that shows in the browser is:
[example.com...]

Through trial & error, I seem to have isolated it to the longer URL and/or the .htm "filename". I tried swapping the order of the code around, etc., to try to identify the problem; If I request the longer URL, it always produces the error. I'm guessing it's some kind of difference in the way the server processes the two errors, though I can't figure out why.

I'm also guessing that it might have to do with a server upgrade or service pack, although the affected sites moved which means some small setting might not have transferred properly.

Any thoughts from the IIS gurus here?

Xoc

4:26 am on Nov 28, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Roger, this is related to that checkbox in the IIS manager dialog that needs to be checked. You can re-enable it in IIS Manager, by going to the web site properties, home directory tab, press the configuration button, selecting .htm, press Edit, and making sure the Check that File Exists checkbox is checked.

If .htm doesn't exist, then you can copy the settings from .asp and add it.

You should make sure that that checkbox is checked for all of the file extensions.

I actually sent you a picture of this setting in my email on 1/28/2003 when I worked on that project for you! :)

rogerd

5:14 pm on Nov 29, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Thanks, Xoc... :)