我的本地主机上有以下URL:
http://localhost/?cmd=causeListByCourtName
http://localhost/?cmd=here could be any other page name
我试图重写网址,例如=
http://localhost/page/causeListByCourtName
我已经试过了:
RewriteEngine On
RewriteRule ^pages/(.+)/?$ .+/?cmd=$1 [NC,L]
# Handle pages requests
但是它什么也没做。我在Windows 7的httpd.conf中使用XAMPP:
LoadModule rewrite_module modules/mod_rewrite.so
已启用。我做错了什么?
您还需要确保在找到的httpd.conf文件中都已将其更改AllowOverride None
为AllowOverride All
。
尝试以这种方式进行。
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^page/(.+)/?$ /?cmd=$1 [NC,L]
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句