当前代码:
Options +FollowSymLinks
Options -Multiviews
RewriteEngine On
RewriteRule ^url-testing/index\.php\?var\=indexs$ /url-testing/indexs.php [L]
原始网址:localhost/url-testing/indexs
重写网址:localhost/url-testing/index.php?var=indexs
答案 0 :(得分:0)
你需要改变你的规则:
RewriteEngine On
RewriteBase /
RewriteRule ^url-testing/indexs$ url-testing/index.php?var=indexs [R,L,NC]
或者更全面的规则:
RewriteRule ^url-testing/(*.?)$ url-testing/index.php?var=$1 [R,L,NC]
您还需要检查此虚拟主机的选项,请确保在设置此选项的选项中
AllowOverride All