How to make 301 redirect using .htaccess file

What is 301 Redirect and why to use it?

When you run a new website, you will not need the 301 redirect immediately, but after some period of time, you may decide to change the URL of a page, remove a page or even move a page to another website, the question is, how to prevent seeing 404 error when you change the page URL, and also how to pass the page rank of the moved page to the new page to show it in Google search at the same rank?

The answer is by using 301 redirect, the purpose of using 301 redirect is to tell the browser and the search engine that this URL for this page is moved permanently to another one.

How to setup 301 redirect for a page using htaccess?

To redirect a page (old_url) to another page (new_url) just write this line in you htaccess

Redirect 301 old_urlĀ  new_url

A real example about what we said, is the following code:

Redirect 301 /about.htm http://www.clogica.com

This code will converts you from about.htm to http://www.clogica.com when you are trying to explore about.htm

Click here to see how to redirect a folder to anther folder >>

Comments
  1. No comments yet!, be the first to post a comment.

Your email will not be published, The required fields marked with '*'

*