You have to create .htaccess and paste this code:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
Question
I have this site mamgrow.lt. I want to enter mamgrow.lt
in the browser and that www
would appear automatically in the link after I enter it. Is it possible?
mamgrow.lt ----> ENTER ----> www.mamgrow.lt
Or should I simply redirect user to www.mamgrow.lt when he enters?
La solution
You have to create .htaccess and paste this code:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
Autres conseils
If you are using Apache as a webserver you can do this using a .htaccess file:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
Yes, it is possible using .htaccess:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]