求一段伪静态代码
原地址 http://mytaobaoke/index.php?q=手机 (手机可能是数字,字母,汉字 ,符号等)
重定向到 index.php/index/index/q?q=手机
不能影响其他的链接,比如访问 http://mytaobaoke/index.php 还是访问的以前的路径,只有后面是 http://mytaobaoke/index.php?q=手机 时 ,才重定向到 index.php/index/index/q?q=手机
用在apache2.4上,以下是我的代码,一直不行
<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^index.php?q=(.*)$ index.php/index/index/q?q=$1 [QSA,PT,L]
</IfModule>