如何这个网址:URL Rewrting规则
www.domain.com/services.php?hello-world-be-active
可以被改写为:
www.domain.com/services/hello-world-be-active
更新:
下面的规则是不工作...我使用这个规则
RewriteCond %{THE_REQUEST} ^GET\ /(.+)\.php [NC]
RewriteRule^/%1 [QSA,R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ /$1.php
上述规则的结果如下:
www.domain.com/whatever.php => www.domain.com/whatever (Correct)
www.domain.com/whatever.php?whatever-whatever => www.domain.com/whatever?whatever-whatever (Not Correct because question mark '?' should replace with slash '/')
,看一下http://stackoverflow.com/questions/13003319/htaccess-rewrite-query-string-as-path –