on Jun 7th, 2008Adding 301 redirects using htaccess

It’s easy adding 301 redirects to your website using Apache’s htaccess. A 301 redirect is the most efficient and Search Engine Friendly method for web page redirection. It’s not difficult to implement and will preserve your search engine rankings as well.

So, basically how this works is when someone tries to access your website without the (www), it will redirect the URL to your website with the www.

To implement this for your website follow these instructions:

  1. Open up notepad or any other text editor and copy and paste the commands below.
  2. Change (yourdomain) to your domain name.
  3. Save the file with this name: (.htaccess). There is no file name.
  4. Upload it to the root directory of your website.
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^yourdomain\.com$ [NC]
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [R=301,L]
Bookmark This

Trackback URI | Comments RSS

Leave a Reply

Are you Human?