homepage Welcome to WebmasterWorld Guest from 54.237.78.165
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
Forum Library, Charter, Moderators: ocean10000

Microsoft IIS Web Server and ASP.NET Forum

    
Dynamic 301 redirect from old asp site to new asp.net site
Dynamic 301 redirect from old asp site to new asp.net site
rumblepup

10+ Year Member



 
Msg#: 3322670 posted 4:38 pm on Apr 26, 2007 (gmt 0)

Hello everyone. I've been going nuts about this for awhile, but I just can't find the answer. I'm not a coder, but a script scraper, so I'm dead if I can't do this.

I'm changing a site over from asp to asp.net. One of the problems I'm having is 301 redirecting all of the dynamic urls to their new counterparts. There was only one constant I was able to maintain in the dabase migration, and it was the product table UID (ID's) Those are all the same and the basis for product navigation in both applications.

Well here is my problem. I need to do a 301 redirect from three files:

1. default.asp: (No problem really, just giving you background)

2. prodList.asp: Which are the Category Navigation pages. These look like this:
prodList.asp?idCategory=26

and finally
3. prodView.asp: which is the product detail view.
These look like this:
prodView.asp?idproduct=418

Ok.
For default.asp, just a 301 redirect. Found it here in the forums, no problem.

For prodList.asp, I have to 301 redirect to a corresponding Category page which looks like
SearchResult.aspx?CategoryID=(ID)

I have to do these by hand because the Category ID's are not consistent. I had to re-categorize for better SEO.
So how do I construct an IF/Then statement for the following logic
IF
prodlist.asp?idCategory=(ID)
then redirect to
SearchResult.aspx?CategoryID=(ID)
IF Not
Then
IF
And so on.

And then there is the prodView.asp page. I have to redirect these to like this
prodView.asp?idproduct=(UID)
detail.aspx?=ID(UID)
both the UID numbers will be the same number.

I'm hoping that I can do this with a couple of lines of code , to make life easier for myself.

Any help. Please! Please! Please! Please!
(I ain't to proud to beg)

 

seizer

5+ Year Member



 
Msg#: 3322670 posted 6:31 pm on May 14, 2007 (gmt 0)

What you need to do is read the querystring.

---code--

Dim catid
catid = Request.Querystring("CategoryID")
Response.Redirect("SearchResult.aspx?CategoryID=" + catid)

-- end code --

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved