Changing Url Structure - 300K+ Links.. Need suggestions

mataff

Junior Member
Joined
Sep 21, 2008
Messages
139
Reaction score
55
Just about to change the url structure on one of my sites and needed a suggestion on the best method without getting slammed by the SE's. Basically I just want to drop the html from the urls and 301 redirect all of the pages.

Old URL: http://example.com/test/test.html
New URL: http://example.com/test/test

I've previously done this on a much smaller scale 10-20 links but never 300K+. I have my reasons as to why they need to be changed so my question is would my website get slammed for redirecting so many links?
 
.htaccess

Code:
redirect 301 /(.*)/(.*).html /$1/$2/


Remember you want a trailing slash
 
It is beginning to look like Google penalizes for this. Or, at least, you run the risk of a temporary setback. Wish Google would be clear on this
 
I think you will get a set back. It'll take time but maybe months to recover.

Actually I would try a 302. An on domain 302 is dynamite. G treats 301s and 302s totally differently. And 302s to pages on your own domain get a huge free pass. There is a thread here at BHW about it somewhere.

Leave it at a 302. After a few months they will treat it as a 301 any way.
 
Last edited:
.htaccess

Code:
redirect 301 /(.*)/(.*).html /$1/$2/


Remember you want a trailing slash

I think you will get a set back. It'll take time but maybe months to recover.

Actually I would try a 302. An on domain 302 is dynamite. G treats 301s and 302s totally differently. And 302s to pages on your own domain get a huge free pass. There is a thread here at BHW about it somewhere.

Leave it at a 302. After a few months they will treat it as a 301 any way.

Thanks for the advice. Just finished the updates and now everything is converting over.

Went ahead and added a third rule to pick up the urls without trailing slashes and converted them to slashes. I was a bit sloppy when I initially set up the site (it was supposed to only be a test site) so it took in everything after the last slash as a parameter.

In case anyone needs these, here are both sections of rules for both parts of my site:

Section #1

Original URL: http://example.com/main/page/page1.html

RewriteRule ^main/(.*)/(.*).html$ /main/$1/$2/ [R=302] (Convert all .html)
RewriteRule ^main/([^/]*)/([^/]*)$ /main/$1/$2/ [R=302] (Convert all links not ending with a slash)
RewriteRule ^main/([^/]*)/([^/]*)/ /somescript.php?parama=$1&paramb=$2 [QSA,PT]

Section #2

Original URL: http://example.com/other/backup/first.html

RewriteRule ^other/backup/(.*).html$ /other/backup/$1/ [R=302] (Convert all .html)
RewriteRule ^other/backup/([^/]*)$ /other/backup/$1/ [R=302] (Convert all links not ending with a slash)
RewriteRule ^other/backup/([^/]*)/ /anotherScript.php?parama=$1 [QSA,PT]

Hopefully the 302 saves my arse because I'm not looking forward to a hit that lasts longer then a week.
 
Back
Top