htaccess的改变的index.php?毫秒=用户/用户用户、htaccess、index、php

由网友(不帅你报警)分享简介:我要重定向我的网站网址与301 code I want to redirect my site url's with 301 code http://www.domain.com/index.php?ms=user&ms_1=name --> http://www.domain.com/user/nameh...

我要重定向我的网站网址与301 code

I want to redirect my site url's with 301 code

http://www.domain.com/index.php?ms=user&ms_1=name   -->  http://www.domain.com/user/name
http://www.domain.com/index.php?ms=2652&ms_1=title  -->  http://www.domain.com/2652/title
http://www.domain.com/index.php?ms=questions        -->  http://www.domain.com/questions
http://www.domain.com/index.php?ms=aaa&ms_1=bbb&ms_2=ccc      -->  http://www.domain.com/aaa/bbb/ccc

MS的东西可以有空间和UTF8字符太

the stuffs after ms can have space and utf8 characters too

我该怎么办呢?

推荐答案

这应该工作

RewriteEngine On
RewriteCond %{THE_REQUEST} ^(GET|POST) /index.php?ms=(.*)&ms_1=(.*)&ms_2=(.*) HTTP
RewriteRule ^ /%2/%3/%4? [R=301,L]
RewriteRule ^(.*)/(.*)/(.*)$ /index.php?ms=$1&ms_1=$2&ms_2=$3 [L]

RewriteCond %{THE_REQUEST} ^(GET|POST) /index.php?ms=(.*)&ms_1=(.*) HTTP
RewriteRule ^ /%2/%3? [R=301,L]
RewriteRule ^(.*)/(.*)$ /index.php?ms=$1&ms_1=$2 [L]

RewriteCond %{THE_REQUEST} ^(GET|POST) /index.php?ms=(.*) HTTP
RewriteRule ^ /%2? [R=301,L]
RewriteRule ^(.*)/$ /index.php?ms=$1 [L]

这将改变 http://www.domain.com/index.php?ms=aaa&ms_1=bbb&ms_2=ccc http://www.domain.com/aaa/bbb/ccc ,但你看到 http://www.domain.com/index的内容。 PHP毫秒= AAA&放大器; ms_1 = BBB&放大器; ms_2 = CCC 等其他两个环节必须

It will change http://www.domain.com/index.php?ms=aaa&ms_1=bbb&ms_2=ccc into http://www.domain.com/aaa/bbb/ccc, but all you to see the content of http://www.domain.com/index.php?ms=aaa&ms_1=bbb&ms_2=ccc etc for the other two links you have.

阅读全文

相关推荐

最新文章