Forum Moderators: open

Message Too Old, No Replies

url rewriting in ASP?

url rewriting in ASP?

         

helloponty

7:08 pm on Feb 24, 2006 (gmt 0)

10+ Year Member



Can anyone sugesst me how to accomplish URL rewriting in ASP?

I did Googling but al of them lead me URL rewriting in ASP.NET with ihttp module.

Easy_Coder

9:13 pm on Feb 24, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You'd need an isapi dll.

There's tons o posts here on that subject. Search google for:
site:webmasterworld.com +isapi +asp

helloponty

1:02 am on Feb 26, 2006 (gmt 0)

10+ Year Member



Thanks!

dataguy

3:22 pm on Feb 26, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you point your custom 404 error setting to an asp page on your site, you can get the requested page from the query string and generate a page based on the requested URL. This functions the same as a URL rewrite and doesn't require an additional component.

I've got a few million "ghost" pages that use this technique and it works quite well.

carguy84

2:59 pm on Mar 1, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



^ that's what I do.

<%
Dim strRefer
strRefer = lcase(Request.ServerVariables("QUERY_STRING"))

if instr(1, strRefer, "/exmaple1/") then

Response.Status = "200 OK"
Server.Transfer("/example2/file.asp")

elseif instr(1, strRefer, "/example3/") then

Response.Status = "200 OK"
Server.Transfer("/example3/file.asp")

elseif instr(1, strRefer, "/example3/") then

Response.Status = "200 OK"
Server.Transfer("/example4/file.asp")

else

Server.Transfer("/error.asp")

end if
%>