时间:2021-07-01 10:21:17 帮助过:20人阅读
RewriteRule ^(.*)/abc(.*).html$ $1/index\.php?page=abc$2RewriteRule ^(.*)/a/(.*)$ $1/a/index\.php?id=$2RewriteRule ^(.*)/b/(.*)$ $1/b/index\.php?id=$2RewriteRule ^(.*)/(.*).html?id=(.*)&ty=(.*)$ $1/index\.php?page=$2&id=$3&ty=$4
RewriteRule ^(.*)/abc(.*).html$ $1/index\.php?page=abc$2RewriteRule ^(.*)/a/(.*)$ $1/a/index\.php?id=$2RewriteRule ^(.*)/b/(.*)$ $1/b/index\.php?id=$2RewriteRule ^(.*)/(.*).html?id=(.*)&ty=(.*)$ $1/index\.php?page=$2&id=$3&ty=$4
RewriteRule ^(.*)/abc(.*).html$ $1/index\.php?page=abc$2RewriteRule ^(.*)/a/(.*)$ $1/a/index\.php?id=$2RewriteRule ^(.*)/b/(.*)$ $1/b/index\.php?id=$2RewriteRule ^(.*)/(.*).html?id=(.*)&ty=(.*)$ $1/index\.php?page=$2&id=$3&ty=$4
RewriteRule ^(.*)/abc(.*).html$ $1/index\.php?page=abc$2RewriteRule ^(.*)/a/(.*)$ $1/a/index\.php?id=$2RewriteRule ^(.*)/b/(.*)$ $1/b/index\.php?id=$2RewriteRule ^(.*)/(.*).html?id=(.*)&ty=(.*)$ $1/index\.php?page=$2&id=$3&ty=$4
其实就是想把/xxxx.html?id=123&ty=aaa这个请求中的" xxxx.html?"部分换成"index.php?mod=xxxx&"
其实就是想把/xxxx.html?id=123&ty=aaa这个请求中的" xxxx.html?"部分换成"index.php?mod=xxxx&"
其实就是想把/xxxx.html?id=123&ty=aaa这个请求中的" xxxx.html?"部分换成"index.php?mod=xxxx&"
问题依然存在,还有人能指点一下不
RewriteRule ^(.*)/(.*).html?(.*)$ $1/index\.php?page=$2
RewriteRule ^(.*)/(.*).html?(.*)$ $1/index\.php?page=xxxx $2
RewriteRule ^(.*)/xxx.html?(.*)$ $1/index\.php?page=xxxx $2
RewriteRule ^(.*)/xxx.html?(.*)$ $1/index\.php\?page=xxxx $2
RewriteRule ^(.*).html\?(.*)$ index.php?mod=$1&$2
感谢楼上两位,我自己找到答案了
/xxxx.html?id=123&ty=aaa匹配规则如下
RewriteCond %{QUERY_STRING} ^id=(.+)&ty=(.+)$
RewriteRule xxxx\.html$ index\.php\?page=xxxx&id=%1&ty=%2 [L]
这个规则就可以匹配html后面有参数的url。