Posts Tagged ‘Redirect to www’

Redirect to www

March 1st, 2011

Create a .htaccess file with the below code, it will ensure that all requests coming in to domain.com will get redirected to www.manoj.com

The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^manoj.com [nc]
rewriterule ^(.*)$ http://www.manoj.com/$1 [r=301,nc]

Please REPLACE  manoj.com with your actual domain name.

Note* This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled.