301 Redirect Instructions – Non www to www

  September 12, 2006   Category :     Website Coding   Directory One

Below are 301 Redirect Instructions to go from Non www to www.

Word of warning, you will have to edit your .htaccess file to accomplish this. Please be careful and always make a backup of the original just in case there is a problem.

First, open your .htaccess file with a plain text editor such as notepad. Next copy and paste the following code into the .htaccess file;

RewriteEngine on

RewriteCond %{HTTP_HOST} ^yoursite\.com$ [NC] RewriteRule ^(.*)$ http://www.yoursite.com/$1 [R=301,L]

Next, simply replace “yoursite” with your unique URL, save and upload. Now when somebody types in yoursite.com they will be automatically redirected to www.yoursite.com.

About The Author

Comments are closed.