- Written by
KumarAyush
- Posted at 10:57 am
I received a mail from one of my client who wanted do redirect his domain (http://abc.com) to proper www URL (http://www.abc.com)
Earlier I had worked on those cases where we need to redirect old/obsolete pages to new url and it was simple.
Using a 301 redirect on the non-www version of the URL, which is a permanent redirect , you can effectively joined all of your link popularity to a single URL. And this techniques helps by many seo specialist and seo expert in order to increase website’s chances of obtaining and maintaining top rankings.
How To Enable The 301 Redirect on a Apache Server
Here is the solution how you can redirect non www to www URL using 301 permanent redirect code.
1. Make sure that your hosting provider has the Apache Rewrite Module turned on.
2. Download .htacess file on your system and rename existing file on the server.
3. Add following code mentioned on .htaccess file, mentioned below in Green color.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^abc.com
RewriteRule (.*) http://www.abc.com/$1 [R=301,L]
4. Upload this .htaccess file on the root folder.
That’s all, its done.