Welcome to WebmasterWorld Guest from 54.147.10.72

Forum Moderators: ocean10000

Message Too Old, No Replies

301 redirect on dynamic pages

Moved to static pages - How do I stop duplicate content in search engines

     

Elmo

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

10+ Year Member



Situation

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

Birdman

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

WebmasterWorld Senior Member 10+ Year Member



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"

Regards,
Birdman

Elmo

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

10+ Year Member



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.

dotme

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

10+ Year Member



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 & ""

macrost

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

10+ Year Member



dotme,
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>

Mac

Elmo

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

10+ Year Member



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

Elmo

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

10+ Year Member



I have added the code as suggested and it works.

Thanks for the help Dotme and Birdman.

 

Featured Threads

Hot Threads This Week

Hot Threads This Month