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 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 Link to comment https://forums.phpfreaks.com/topic/168837-strange-loop-error/#findComment-891310 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.