rumblepup
02-06-2007, 03:13 PM
Hello all. I've been trying to figure out a redirect system for a site that I'm updating from classic asp to asp.net.
Currently, the site has some product search and product detail pages such as:
prodList.asp?idCategory=9
or
prodView.asp?idproduct=55
Well, what I want to do is create a 301 redirect from those pages to the new one, based on the idCategory parameter or the idproduct parameter.
I found neat little 301 redirect code
<%@ Language=VBScript %>
<%
Response.Status="301 Moved Permanently" Response.AddHeader "Location", " http://www.new-url.com"
>
But I want to create a series of IF/Then statements that will redirect based on the uri parameter, and I'm not sure how to do it.
In other words, my logic is -
If WEBSITE uri = ../prodView.asp?idproduct=55
THEN
Response.Status="301 Moved Permanently" Response.AddHeader "Location", "new-url(dot)com"
I have to do this one line at a time because the Product ID's and the Category ID's will change with the new asp.net application.
In any case, any ideas? I've never written code from scratch, that's why I stink at this.
Thanks ahead of time.
Currently, the site has some product search and product detail pages such as:
prodList.asp?idCategory=9
or
prodView.asp?idproduct=55
Well, what I want to do is create a 301 redirect from those pages to the new one, based on the idCategory parameter or the idproduct parameter.
I found neat little 301 redirect code
<%@ Language=VBScript %>
<%
Response.Status="301 Moved Permanently" Response.AddHeader "Location", " http://www.new-url.com"
>
But I want to create a series of IF/Then statements that will redirect based on the uri parameter, and I'm not sure how to do it.
In other words, my logic is -
If WEBSITE uri = ../prodView.asp?idproduct=55
THEN
Response.Status="301 Moved Permanently" Response.AddHeader "Location", "new-url(dot)com"
I have to do this one line at a time because the Product ID's and the Category ID's will change with the new asp.net application.
In any case, any ideas? I've never written code from scratch, that's why I stink at this.
Thanks ahead of time.