当前代码:
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
当前代码:
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
You need to turn your rule around:
RewriteEngine On
RewriteBase /
RewriteRule ^url-testing/indexs$ url-testing/index.php?var=indexs [R,L,NC]
Alternatively for a more global rule:
RewriteRule ^url-testing/(*.?)$ url-testing/index.php?var=$1 [R,L,NC]
You also need to check options for this virtual host, make sure in options that this is set:
AllowOverride All