Posted in Tutorial

301 Redirect Using .htaccess

301 Redirect Using .htaccess Posted on July 6, 20141 Comment

Deepanker Verma is the CEO of Techlomedia and a full time blogger. On this blog, he shares web design resources, SEO tips blog monetization tips.

301 redirection htaccess
Best WordPress Hosting

Sometimes we need to change the URL of the page. Changing the URL is simple but there are few risks in this. If you are changing the URL of page which is popular and indexed in search engine, you are going to loose the visitors and ranking both. So, you should always do this process with extra care. Once you have changed the URL, redirect the old URL to the new to pass visitors and ranking both. This redirect should be 301 redirect. 301 redirect tells search engines that web page has been moved permanently to the new web address.

301 Redirects

In this post, we will see how to do proper 301 redirection using htaccess file.

Advertisement

Where is .htaccess file on the server?

.htaccess file is located at the root folder of your website. You can easily find the program from any FTP program or file browser of cpanel. Be sure to show hidden files if you are unable to find this file on your website’s root directory.

Note: Take a backup of the file before any kind of changes.

Redirect single file

If you only want to redirect a single file, just add this line in the .htacess file.

Redirect an entire site to new domain

This way of redirection also preserves old links. It means, www.olddomain.com/page.html will becone www.newsite.com/page.html

Redirect all files with certain extension

Redirect from www to non-www location

Redirect to www location from non-www location

advertisement

Deepanker Verma is the CEO of Techlomedia and a full time blogger. On this blog, he shares web design resources, SEO tips blog monetization tips.

1 thought on “301 Redirect Using .htaccess

  1. Hey Deepanker!!!! you write it well. I really don’t know about it. I thought it can only be done when we buy domain.

Leave a Reply

Your email address will not be published. Required fields are marked *

Subscribe To Our Newsletter

Subscribe To Our Newsletter

Receive fresh web design resources and SEO tips in your email by our weekly newsletter

You have Successfully Subscribed!