0
我需要有mod_rewrite的规则去除的index.php
site.com/index.php?s=super-smash-bros-baww-SUzohN
重定向到
site.com/super-smash-bros-baww-SUzohN
。
我该怎么做?
注意单词的数量可以是不同的e.g:/index.php?s=aaa-bbb-ccc
需要去/aaa-bbb-ccc
感谢
我需要有mod_rewrite的规则去除的index.php
site.com/index.php?s=super-smash-bros-baww-SUzohN
重定向到
site.com/super-smash-bros-baww-SUzohN
。
我该怎么做?
注意单词的数量可以是不同的e.g:/index.php?s=aaa-bbb-ccc
需要去/aaa-bbb-ccc
感谢
尝试添加下列到.htaccess
文件在您的网站的根目录。
RewriteEngine on
RewriteBase/
#redirect to remove index.php
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\?s=([^\ &]+) [NC]
RewriteRule^%1? [L,R=301]
#process the SEF Url with index.php
RewriteRule ^([-a-zA-Z]+)$ index.php?s=$1 [L]
它的工作,谢谢。 – giany 2012-02-07 14:49:29