Reputation: 14490
I am using this rule into my .htaccess to redirect IE 6 and 7 users to a specific url:
RewriteCond %{HTTP_USER_AGENT} MSIE\ ([67])\.
RewriteRule (.*) http://www.example.com/ie/$1 [R=301,L]
but it ends up that users get to a website:
www.example.com/ie/ie/ie/ie/ie/ie/ie/ie/ie/ie/ie/ie/ie/ie/ie/ie/ie/ie/ie/ie/ie/ie/ie/ie/ie
and it keeps going on forever.
What I'm I doing wrong?
Upvotes: 1
Views: 376
Reputation: 7866
See, [R=301,L] means it really redirects (with http status 301) to a new location, meaning the browser will come again into same location with ie/ added... and everything will happen again.
What you need to do is add another RewriteCond
before the rule:
RewriteCond %{REQUEST_URI} !^/ie/
This way, if MSIE comes in to /ie/something uri, this request will not be rewritten...
Upvotes: 2