user1804599
user1804599

Reputation:

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:

Request exceeded the limit of 10 internal redirects due to probable configuration error.

What could be wrong?

Upvotes: 0

Views: 42

Answers (1)

Jon Lin
Jon Lin

Reputation: 143946

The %{REQUEST_URI} variable always starts with a /, so you need to include that in your regex:

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

Upvotes: 2

Related Questions