[eluser]Unknown[/eluser]
Hi Codeigniter community!
I´ve been this .htaccess and all works OK! but i want to redirect always to a www. site not to non-www site
This is .htaccess that remove index.php and works OK
Code:
RewriteEngine On
#This bit does the codeigniter magic
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
But if i try with this:
Code:
RewriteEngine On
#This bit rewrites your host name to include www
RewriteCond %{HTTP_HOST} !^www\.mysite\.com [NC]
RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=301,NC,L]
#This bit does the codeigniter magic
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
Server says me that i´ve got a redirect loop.
How can i redirect to www site and remove index.php?
thanks