Hey all. I got a really good response from tgo on how to implement a series of 301 redirects using asp, http://forums.digitalpoint.com/showthread.php?t=238610 and he gave me this bit of code: However, on that thread, I mentioned that all the product id's would change when I migrated the database from one to another. During that exercise, I found a way to keep my original product UID's (ID's) so there is one constant between the to apps. /prodView.asp?idproduct=55 should point to /detail.aspx?=ID55 So, is there a way for me to do this with just a couple of lines of code instead of an if then statement for each product ID My logic is this IF /prodView.asp?idproduct=<THE PRODUCT ID NUMBER> THEN response.redirect /detail.aspx?=<THE SAME PRODUCT ID> Any help please?
<% If IsNumeric(Request.QueryString("idproduct")) Then ' Or you can put Request.QueryString("idproduct") <> "" Response.redirect("/detail.aspx?=" & Request.QueryString("idproduct")) End If %> Note that this is not 301 redirect. For 301 redirect, please use Response.AddHeader Hope it helps
Have you considered using Helicon's isapi rewrite filter to do this dynamically rather than coding it in the site? If you do, you can add seo to the equation by using text names for the products and an 'htm' extension. I do this on my site and rather than have /content.asp?id=112, I have urls like high output alternator. I use the tilde because I have hyphens in the file names. I do use a 301 redirect if someone comes in on the old link so there are no 404's.