Keral_Patel
I'll do itRestricted (Chatroom)
- Impact
- 1,435
Redirecting your sitename.com to www.sitename.com with help of .htaccess
Create a .htaccess file or add the code to an existing one on your server.
If you are creating a new .htaccess file make sure it is in the root folder of the site.
Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^sitename.com [nc]
rewriterule ^(.*)$ http://www.sitename.com/$1 [r=301,nc]
Where sitename.com and www.sitename.com will be replaced by your original details of the site itself.
This will only work on apache servers with mod_rewrite enabled.
Create a .htaccess file or add the code to an existing one on your server.
If you are creating a new .htaccess file make sure it is in the root folder of the site.
Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^sitename.com [nc]
rewriterule ^(.*)$ http://www.sitename.com/$1 [r=301,nc]
Where sitename.com and www.sitename.com will be replaced by your original details of the site itself.
This will only work on apache servers with mod_rewrite enabled.
Last edited: