Forum Moderators: open

Message Too Old, No Replies

Custom 404 and URL

How to keep an URL in the Address bar after redirection

         

freitasm

4:26 am on Jun 15, 2006 (gmt 0)

10+ Year Member Top Contributors Of The Month



Hello...

I have a custom 404.asp that scans an invalid URL and following some rules issues the following:

---
response.addheader "Location", session("serverpath") & "/blog.asp?blogid=" & blogid & "&postid=" & postid
response.end
---

So, if someone enters [[mydomain]...] it will lookup in the SQL database, find that user "freitasm" has a blog id "123" and redirect to the proper script as [[mydomain]...]

This way I can host multiple "blogs" for my users.

All works fine, however, when the page is loaded the browser shows the new redirected URL (blog.asp?blogid=123&postid=503) instead of the one originally entered (freitasm/503)

Is there any way to instruct the browser, during this redirection, to keep the original URL entered in the address bar instead of showing the new one?

Cheers

wardbekker

11:25 am on Jun 15, 2006 (gmt 0)

10+ Year Member



Hi,

You might want to give a look into URL rewriting using regular expression. That way you can have multiple urls pointing to the same page.

A search into these forums on url rewriting should give you a good starting point.

Regards,

Ward