301 Redirect for multiple old urls

Discuss practical ways rearrange URLs using mod_rewrite.

301 Redirect for multiple old urls

Postby Haran » Wed Aug 25, 2010 7:01 am

Hi guys, I've changed CMS and so, all the old urls have to redirected.

Here an example of old urls:
Code: Select all
http://www.misite.com/test.cgi?cdo=001JHGJGJGJG
http://www.misite.com/test.cgi?cdo=001JHGJGJGJG&lng=EN
http://www.misite.com/public/test.cgi?cdo=001JHGJGJGJG
http://www.misite.com/public/test.cgi?cdo=001JHGJGJGJG&lng=EN
http://www.misite.com/EN/some/dirs/001JHGJGJGJG-somecode


they all pointed to the same page. Now I need to redirect all those urls to the new one that doesn't contain any code, just useful keywords:
Code: Select all
http://www.misite.com/some/keywords/here/pagename


I tried using the following rules but they don't work:
Code: Select all
RewriteRule 001JHGJGJGJG-(.*)$ http://www.misite.com/some/keywords/here/pagename [R=301]
RewriteRule 001JHGJGJGJG$ http://www.misite.com/some/keywords/here/pagename [R=301,L]


What am I doing the wrong way?


Thanks,
Haran
Haran
 
Posts: 16
Joined: Sat Feb 21, 2009 1:09 pm

Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 30 guests

cron