开发者

redirecting old rewrite rule into a new one

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜