[英]Apache Mod Re-write - re-write causing 500 Error
我正在使用Go爸爸虛擬服務器,並上傳了以下htaccess文件:
RewriteEngine on
RewriteCond $1 !^(index\.php?|images|styles|scripts|favicon\.ico|favicon\.png|robots\.txt)
RewriteRule ^(.*)$ index.php?/$1 [L]
我正在嘗試刪除index.php? 從URL,但失敗會導致500錯誤。
誰能說出這可能導致500錯誤的原因? 提前致謝
您不能從RewriteCond
訪問$1
,因為RewriteCond
在RewriteRule
之前進行求值。 也許就是這樣,您應該寫:
RewriteEngine On
RewriteCond %{REQUEST_URI} !^(index\.php|...)
RewriteRule ...
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.