e.php?b_name=jin&b_id=3&p=2
这是我PHP的URL,其中P是页数
我希望重写后改成b-jin-3/2/的我写了一个可是不行,不知道哪里的问题,请高手指教
RewriteCond %{QUERY_STRING} ^p=(.*)$
RewriteRule ^b-(.*)-([0-9]*)/(.*)/$ e.php?b_name=$1&b_id=$2&p=%1 [L]

解决方案 »

  1.   

    这是由于apache路由重写,对所有的路径都重写了。对一些不需要地址重写的要正则过滤;
    下面是我 .htaccess 文件内容,你参照下修改吧。
    RewriteEngine on
    RewriteCond $1 !^(index\.php|static|install|robots\.txt) 
    RewriteRule ^(.*)$ /index.php/$1 [L]
    其中:
    RewriteCond $1 !^(index\.php|static|install|robots\.txt) 
    是对 static 等目录不进行路径重写;祝你成功