View Single Post
  #1  
Old 03-05-2008, 02:17 PM
deshabhishek007 deshabhishek007 is offline
New user
 
Join Date: May 2008
Location: Nagpur
Posts: 28
Rep Power: 0
deshabhishek007 is on a distinguished road
Send a message via MSN to deshabhishek007 Send a message via Yahoo to deshabhishek007
Redirecting sitename to www.sitename

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.
Reply With Quote