why this httaccess code results into a redirect loop?

Posted by user3606997 on Stack Overflow See other posts from Stack Overflow or by user3606997
Published on 2014-06-01T14:59:42Z Indexed on 2014/06/01 15:25 UTC
Read the original article Hit count: 151

Filed under:
|

Here I am stuck with my htaccess code. I have been trying to figure it out for the last 11 hours why am I getting a redirect loop for the below code.

Options -Indexes +FollowSymLinks
RewriteEngine on

#Check for no www or www
RewriteCond %{HTTP_HOST} ^dummysite.com$ [or]
RewriteCond %{HTTP_HOST} ^www.dummysite.com$ [NC]
RewriteRule . - [E=FIRSTPART:true]

# IE 6
RewriteCond %{HTTP_USER_AGENT} !MSIE\s6

RewriteCond  %{ENV:FIRSTPART}  true
RewriteRule ^(.*)$ https://www.dummysite.com/$1 [R=302,L]

Why the above code results into a redirect loop?

EDIT: What I actually want is that if the user is from IE6 then he should be redirected to http version with www as prefix no matter if he types www or not in the url. And on the other hand if the user is from any other browsers then he should be redirected to a https version with www as prefix no matter if he types www in the url or not.

© Stack Overflow or respective owner

Related posts about apache

Related posts about .htaccess