How To:Setup a 301 Redirect?

Hey all, if you are thinking that I am going to tell you a very lengthy process for doin this kind of process then you are completely wrong. I  will only take 4 minutes of yours, 2 minutes for reading this article and 2 minutes for implementing this( rest depends on you).

301 Redirect is a process of redirecting a page/url permanently to another url. The other one for temporary redirection is 302 redirect. For more details Wikipedia.

To do this you have to go to your web server where you have set up your web site or blog and in short the place where you basic files are. There search for the main basic file that has the basic source code of your whole website. This is generally the .htaccess file as used in WordPress and other major blogging platforms. (By default this is not visible, more details)

Now comes the main point, but before this backup your .htaccess file(simply copy the whole code there and paste it in some notepad and save it on your computer in case you need it.

After that add the following code to it:

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_Host} ^YOURDOMAIN.com [NC]
RewriteRule ^(.*)$ http://www.YOURDOMAIN.com/$1 [L,R=301]

You can well see the main domain i.e. YOURDOMAIN.com and the www being redirected to that page( in bold letters). Just replace that with your domain/website name or url and save the file.

Your redirection work is over now, the webpage that is www.YOURDOMAIN.com will redirect to YOURDOMAIN.com when somebody visits that page. Similarly you can add more code to make other redirects as well or use this lovely plugin for WordPress and do all that stuff with coding.