[英]My .htaccess loads but my rewrite rule doesn't work
當前代碼:
Options +FollowSymLinks
Options -Multiviews
RewriteEngine On
RewriteRule ^url-testing/index\.php\?var\=indexs$ /url-testing/indexs.php [L]
原始網址: localhost/url-testing/indexs
重寫的URL: localhost/url-testing/index.php?var=indexs
您需要改變規則:
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
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.