简体   繁体   English

使用mod_rewrite获得无限循环

[英]Getting an infinite loop with mod_rewrite

I have the following configuration: 我有以下配置:

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]

Even though I exclude index.php in the rewrite condition, I still get the following error: 即使我在重写条件中排除了index.php ,我仍然会收到以下错误:

Request exceeded the limit of 10 internal redirects due to probable configuration error. 由于可能的配置错误,请求超出了10个内部重定向的限制。

What could be wrong? 可能有什么不对?

%{REQUEST_URI}变量始终以/开头,因此您需要在正则表达式中包含该变量:

RewriteCond %{REQUEST_URI} !^/(index\.php|robots\.txt|static|uploads)(/.*)?$

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM