I have this rule on my .htaccess file
RewriteRule ^business/(.*)/(.*)/(.*)$ ./businesspage.php?name=$1&place=$2&id=$3
I want to make it shorter for SEO purposes, so there would be only two parameters, $3
& $1
.
However, I want the old U开发者_StackOverflow社区RLs indexed on google to redirect to the new ones. How do I do it?
For example /business/name/place/id
-> /id/name
.
Thanks
Something like this above your existing rule should work for the redirection:
RewriteRule ^business/([^/]+)/[^/]+/([^/]+)$ /$2/$1 [R=301,L]
Then I assume you also want to modify your existing rule like this:
RewriteRule ^([^/]+)/([^/]+)$ /businesspage.php?name=$2&id=$1
精彩评论