I have this on my .htaccess file and I want add a rule to redirect my site from non-www to www.
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
I have this on my .htaccess file and I want add a rule to redirect my site from non-www to www.
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
you can try this
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)index.php$ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]