I would like to redirect example.com to www.example.com.
I tried from .htacess
with right 301 redirect code but doesn't work.
Also without www url redirect to other domain that haven't redirect from .htacess
.
I would like to redirect example.com to www.example.com.
I tried from .htacess
with right 301 redirect code but doesn't work.
Also without www url redirect to other domain that haven't redirect from .htacess
.
You can try this .hataccess
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
</IfModule>
Make sure your .htaccess only one "RewriteEngine On". So, you can put
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
To below RewriteEngine On