regex - 301 redirect to the rewrited url -
the cms working has these rewrite rules:
for tags:
rewriterule ^tags/([^/]+)/$ tag.php?t=$1&page=1 rewriterule ^tags/([^/]+)/page-([0-9]+)(/)?$ tag.php?t=$1&page=$2
for category pages:
rewriterule ^browse-(.*)-videos.html$ category.php?cat=$1 rewriterule ^browse-(.*)-videos-([0-9]+)-(.*).html$ category.php?cat=$1&page=$2&sortby=$3
but not redirect seo friendly url estructure creating duplicate content issues, how can make 301 redirects rewrited url if accessed other?
thanks in advance
you need create 4 new rules , place them above existing.
#redirect old url new seo rewritecond %{the_request} ^get\ /+tag\.php\?t=([^&\s]+)&page=1 rewriterule ^ /tags/%1/? [r=301,l] #redirect old url new seo rewritecond %{the_request} ^get\ /+tag\.php\?t=([^&\s]+)&page=([^&\s]+) rewriterule ^ /tags/%1/page-%2/? [r=301,l] #redirect old url new seo rewritecond %{the_request} ^get\ /+category\.php\?cat=([^&\s]+)&page=([^&\s]+)&sortby=([^&\s]+) rewriterule ^ /browse-%1-videos-%2-%3.html? [r=301,l] #redirect old url new seo rewritecond %{the_request} ^get\ /+category\.php\?cat=([^&\s]+) rewriterule ^ /browse-%1-videos.html? [r=301,l] rewriterule ^tags/([^/]+)/$ tag.php?t=$1&page=1 [l] rewriterule ^tags/([^/]+)/page-([0-9]+)(/)?$ tag.php?t=$1&page=$2 [l] rewriterule ^browse-(.*)-videos.html$ category.php?cat=$1 [l] rewriterule ^browse-(.*)-videos-([0-9]+)-(.*).html$ category.php?cat=$1&page=$2&sortby=$3 [l]
Comments
Post a Comment