What is 301 redirect? And How Can I apply to my website?

What is 301 redirect?
It's the HTML redirection technique to inform search engines that the "page has permanently moved to a new location."

When can I use this function?
301 redirects are useful in the following circumstances:
You have moved your web site to a new domain, and you want to make the transition as seamless as possible.
People access your site through several different URLs. If, for example, your home page can be reached in multiple ways - for instance, http://myhome.com, http://home.myhome.com, or http://www.myhome.com - It's a good idea to keep one of those URLs as your preferred (canonical) destination, and use 301 redirects to send traffic from the other URLs to your preferred URL. You can also use Webmaster Tools to set your preferred domain. In this way you can prevent your page ranking split into 3 or more different URLS. (i.e - Google spider will update it's index for http://myhome.com, http://home.myhome.com, or http://www.myhome.com as 3 different websites)

You're merging two websites and want to make sure that links to outdated URLs are redirected to the correct pages.

How Can I apply to my website?

To implement a 301 redirect for websites that are hosted on servers running Apache, you'll need access to your server's .htaccess file. (If you're not sure about your access or your server software, check with your webhoster.) For more information, consult the Apache .htaccess Tutorial and the Apache URL Rewriting Guide.

In IIS, you need to change the "Home Directory" property to "A redirection to a URL" option and fill the new URL.

with PHP:

Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.newlocation.com" );


with ASP:

Response.Status="301 Moved Permanently"
Response.AddHeader='Location','http://www.newlocation.com'