[英]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.