Setting up a permanent 301 redirect via .htaccess : how to
In which circumstances do you plan to set-up a 301 redirect? How does it serve your organic search engine optimization? What are the consequences from the end user perspective? Each website editor who deals with URL changes should be able to create proper 301 redirects via the .htaccess file. Here a few basic concepts to understand for the use of our tool.
What is a 301 redirect?
When speaking about URL, redirect is the action to drive the user's browser (or the search engine crawler) from one page to another. In other words, redirect is a way to indicate a change in the address of the target web page. “The page you're looking for has been moved somewhere else, let me show you its newest address”, would say your website if it was able to speak.
301 is one of many redirect instructions your web server can handle. It's called a permanent redirect, which means it tells users and robots to replace the former address by the new one.
301 and organic SEO
Because of this permanency, setting up a 301 redirect can have great impact on organic search engine optimization. When meeting a 301, Google's crawlers understand they must take off the old page from the index and replace it with the new one. This takeover embodies the redirected page as if it was the former. The latter keeps all the attributes the former page had in terms of PageRank, page authority or incoming links.
When should a 301 redirect be considered?
Here are some common uses of a 301 .htaccess redirect.
- The former URL is broken (404). When led to a page that doesn't work properly, the browser will ask the server to deliver an error message, the famous 404. In this very same situation, the search engine crawler believes the webpage is dead and delete it after short amount of time.
- The webpage is no longer active. Editors sometimes prefer to transfer their content from one page to the other, instead of updating the former one. Permanent redirection will make this takeover real for both end users and Google.
- Delete old page from index. Direct consequence of the former point : by asking to consider an new URL, you ask search engines to forget the older one.
- Modify your website structure. 301 allows you to convert file extensions (for example, from .php to .html), or to set up favorite way to access your website (example.com instead of and www.example.com).
- Combat duplicate content. If the same content appears at more than one web address, Google sees it as duplicate content, which can impact negatively your rankings. 301 allows you to determine which version of your content should be seen as unique.
- Move to a new domain. Permanent redirect is perfect to move from an old domain to a new one, as it will transfer all the links to the new address. 301 is also useful to modify internal elements as category or directory address.
How to set up a proper 301?
The easiest way to proceed is to modify a small configuration called .htaccess. One created, it will operate for the whole directory he's installed in. This file basically tells the server how webpages should be delivered to the client. Redirect are written in this file as regular expressions.
Which pages should I redirect?
301 redirect is useful in many situations: you're moving to an entirely new domain, your website structure has changed, some incoming links point to broken pages… editors usually focus on high ranking webpages.
Once you got this basic precepts, 301 redirects via .htaccess should become your best friend as a webmaster !