therealwesfoster Posted August 4, 2009 Share Posted August 4, 2009 What's wrong with this code? # ADD WWW. RewriteCond %{REQUEST_URI} !^/robots\.txt$ RewriteCond %{HTTP_HOST} ^domain\.com [NC] RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L,QSA] I keep getting the "never ending loop" error Quote Link to comment https://forums.phpfreaks.com/topic/168837-strange-loop-error/ Share on other sites More sharing options...
lifetalk Posted August 5, 2009 Share Posted August 5, 2009 Hmm.. looking at that code, I don't see the ending '$' in the HTTP_HOST condition line. If your aim is to basically append www. to the url requested, this should work: RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC] RewriteRule ^(.*) http://www.domain.com/$1 [R=301,L,QSA][code] I've not tested it, but it should work Quote Link to comment https://forums.phpfreaks.com/topic/168837-strange-loop-error/#findComment-891310 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.