[英]Getting an infinite loop with mod_rewrite
我有以下配置:
RewriteEngine on
RewriteCond %{REQUEST_URI} !^(index\.php|robots\.txt|static|uploads)(/.*)?$
RewriteRule ^admin(/.*)?$ /index.php/admin$1 [L]
RewriteRule ^([^/]+)(/.*)?$ /index.php/webshops$2?dealer=$1 [L,QSA]
即使我在重寫條件中排除了index.php
,我仍然會收到以下錯誤:
由於可能的配置錯誤,請求超出了10個內部重定向的限制。
可能有什么不對?
%{REQUEST_URI}
變量始終以/
開頭,因此您需要在正則表達式中包含該變量:
RewriteCond %{REQUEST_URI} !^/(index\.php|robots\.txt|static|uploads)(/.*)?$
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.