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

Microsoft IIS Web Server and ASP.NET Forum

301 redirect on dynamic pages
Moved to static pages - How do I stop duplicate content in search engines

 11:54 am on Oct 12, 2004 (gmt 0)


New site
Windows hosted
20,000+ pages
structure as follows

Homepage - default.asp
120 links to level 2 pages

Level 2 pages - www.domain.com/somepage.asp?pageID=123
each level 2 page has 130 links pointing to level 3 pages

My problem is this:

The site has been up only 3 weeks and Google have picked up 4000 pages including all level 2 pages.

We hadn't expected pages to be picked up quite so fast and therefor have a slight problem. We have now changed level 2 pages to - www.domain.com/somepage123
i.e. its own subdirectory with a default.asp page.

Anyone know how we can use a 301 redirect from our somepage.asp?pageID=? page that has 120 IDs to their respective suddirectory pages



 12:11 pm on Oct 12, 2004 (gmt 0)

Hello Elmo,

I'm not an ASP programmer but I believe this should do the job for you. Simply use the paramater from the URL to build your new location. Also, be sure to check the header after implementing to make sure it is working properly.

Response.Status "301 Moved Permanently"
Response.AddHeader "Location", "YOUR_NEW_URL"



 12:54 pm on Oct 12, 2004 (gmt 0)

I'm not an ASP programmer

Nor me

Thanks Birdman

I understand how to do it one page to another, the problem is how do I do it for one page that has 120 IDs which all need to go to different destinations.


 2:10 pm on Oct 12, 2004 (gmt 0)

I think this should do it. Someone else here can maybe check my thinking?

pageid = cstr(request("pageID"))
newurl = "www.domain.com/somepage" & pageid
response.status "301 Moved Permanently"
response.AddHeader "Location", "" & newurl & ""


 2:40 pm on Oct 12, 2004 (gmt 0)

I believe that will work, depending on if they can use a 404 page for the old links. <thinking> hmmmm, that could work, I just wonder if the second level pages are just one page that pulls content depending on the page id, if so, then in that page they can just add that bit of code you have and that should do the trick</thinking>



 4:11 pm on Oct 12, 2004 (gmt 0)

Thanks, I will get back once I have spoken to the programmer.


 12:50 pm on Oct 15, 2004 (gmt 0)

I have added the code as suggested and it works.

Thanks for the help Dotme and Birdman.

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