Forum Moderators: open

Message Too Old, No Replies

IIS 404 Custom Handling - SE Friendly

Possible to Server.Transfer with pid=**** parms & return '200 OK'?

         

weebie

7:43 pm on May 20, 2004 (gmt 0)

10+ Year Member



I'm try to use 404.asp code to create a low maintenance solution for: Handling of (non-existant) static page URLs which actually display corresponding dynamic asp page content which appears to outside world (both users & SE's) to be static...

I found some sample 404.asp code and created a script to generate '404 redirects', from my DB. The generated redirects are then inserted into the 404.asp handling code.

This sends users from the non-existant (very friendly looking) URL: www.site.com/product123.htm to the existing URL: www.site.com/...blah/blah/.../product.asp?pid=1234 This is functional, but since I want these actions to be more user/spider friendly, I have 2 problems with this.

1) WOULD LIKE FINAL DISPLAYED URL to display the static looking product.htm URL after the redirect instead of the targeted page (as if using a Server.Transfer) - only I tried using server transfers and could not pass the '?pid=1234' (request string portion) using Server.Transfer, into the product.asp page.

2) WOULD LIKE ACTIVITIES TRANSPRENT TO SE's. -Returning 200 Status.

Each possibility I have tested so far has led me into a deeeeper hole. Be careful what you ask for - huh?

Thanks - Steve

f00sion

11:34 pm on May 22, 2004 (gmt 0)

10+ Year Member



there is no way to pass querystring values with a server.transfer and doing a redirect wont get you the nice 200 status... if you are using asp.net you could add values to the context collection before doing the transfer and then access them from the receiving page... in classic asp putting the variables in the session object is a possibility, but thats not clean at all.. I would suggest switching over to an isapi plugin such as isapirewrite to solve all your problems. it is very easy to setup and so much easier to maintain than the 404 method. be sure to verify the correct statuses are being returned with one of the many server header checkers available online.

weebie

12:02 am on May 23, 2004 (gmt 0)

10+ Year Member



Thanks for the tip! I've been going down the 404 path which basically leads to nowhere since it can't pass along the parameters to my asp product pages.

I just checked out the isapi_rewrite page and am wondering if their Lite (free) version will work. Do you happen to have any experience with that one? Their little note about "no cache cleanup" for that version sounds a little worriesome.

Thanks again