• Learn SEO

What Is A Redirect

  • Felix Rose-Collins
  • 4 min read

What Is A Redirect A redirect is a method of sending users and search engines to different URLs from one linked anchor. There are three primary redirects used regularly. The most commonly used redirects are listed below:

Permanently Moved Page (301)

this redirection is a permanent move that passes along 90-99% of all the link juice to the redirected page. The code 301 refers to an HTTP status code for redirects. The 301 HTTP status code is the preferred method of website redirecting for permanent moves.

Found/Moved Temporarily (302) (HTP 1.1 / HTTP 1.0)

code 302 is a redirect that is temporary. It does not pass along any link juice to the new location. This redirect is not the ideal solution in most cases. Running on a Hypertext Transfer Protocol (HTTP), which gives instructions to the link on how it should behave. Originally, the code 302 was considered a Temporary page, but this changed to mean found in version 1.1.

Moved Temporarily (307) (HTTP 1.1.)

A 307 redirect is the HTTP 1.1 secondary step of the 302 redirect. The exception is when the content is moved for site maintenance, and the server has been readied. Some major engines use crawlers that view the code 307 as the code 301, so in most instances it is not a favorable choice. The code 302 is still the better choice for a page that has been moved and will later be place back to it’s typical formatting.

Meta Refresh

this is a type of redirect that happens on the page level instead of the server level. This is not a widely recommend SEO technique as it’s slower and not commonly associated with stability. The meta refresh is typically associated with a countdown accompanied by text. There is typically a message that states that if you have not been redirected in 5 second then click the link manually. A meta refresh will pass along some of the link juice, but is still not the optimum redirect choice.

Top SEO Tactics: Redirects

To keep the value of the optimization of your site, it is imperative that redirected traffic actually make it to the properly place. Monitoring best practices and what has worked for other sites is the ideal strategy for building a stellar site. A redirect is not a rare practice in digital circles it’s quite common. A common redirect scenario is for URLs that need to move to another address forever. Many of the redirect codes will function in the capacity, but the 301 redirect is the preferred method for performance.

The 301 redirect tells search engines and browsers that the page in question has been moved permanently. This is further interpreted to mean that in addition to the page changing locations, the content and any updates can be found on this new page. The process will take longer if the crawlers are infrequent visitors to the site. The other redirect codes are unfavorable choices for most instances because of the poor ranking pass along. The only time it is considered a positive alternative to choose one of the redirects besides the code 301 is if the page designer doesn’t care about losing link juice. Content transfer becomes difficult when a site gets a new domain or when the content moves to another location.

301 Sample Problem with Apache

Problem

Launching a first time website that was hosted on another server rather than on a home domain. When moving the website to its new home and dedicated server, it’s important not to create the new site as subdirectory of the host website. The redirect needs to accommodate many files and folder names with changes to code 301 for search engine readiness.

Solution

The easiest correction would be to add to the PHP code a 301 redirect to utilize the functionality of Apache.

Installation

For this to work, a server should have Apache installed. Check with your developer to see if Apache was installed by default. The developer will check for installation by adding a line to the configuration file.

Context

The rewrite module operates in two context, per-server and per-directory. Per-server context requires that the apache files be edited. The per-directory file uses the htaccess files.

Regular Expression (regexes) is a string that matches other strings in a set. There are certain syntax rules that apply, and the program is used by text editors to manipulate bodies of text about patterns. This is a value skill to master and it can be used to redirect URLs.

Below is a list of characters and operators used in regex.

Period – matches whatever it is assigned Asterisk – matches characters as assigned zero to more Plus sign – matches character before and after the main character Parenthesis – this is an enclosed value that is used as a back reference to store a variable for later use. Value 1 and Value 2 – when more than two values are locked in parenthesis.

Redirecting files and folders between domains

A newly developed website needs redirection from an older server to a new one while keeping all the file names preserved.

Example redirect

http://www.xyzabc.com/seo/somefile.php To: /somefile/.php   

SOLUTION: Add the necessary directives to the appropriate file on the xyzabc.com server.

Redirectmatch 301 / seo/ (.*)/$1   

Explanation

The regex: /seo/(.*) lets apache to know to match the SEO folder. The parenthesis tells Apache to save the string as back reference.

Redirecting Canonical Hostnames

A web developer needs to redirect all requests that do not begin with www.xyzabc.com. This was done to make sure that they did not encounter any canonicalization errors.

Redirect: http://xyzabc.com  To: http://www.xyzabc.com  
Redirect: http://mail.xyzabc.com/  To: http://www.xyzabc.com 
Redirect: http://xyzabc.com/somefile.php  To: http://www.xyzabc.com/somefile.php   

SOLUTION: Add the appropriate directives

RewriteCond %{HTTP_HOST} *!^www*.xyzabc.com\.org [NC]   RewriteRule (.*) http://www.xyzabc.com/$1 [L,R=301]   

Explanation

Apache is told by the directive that the host needs examining and the visitor is accessing and let’s the program know that if the URL is not equal to the set terms to redirect to the new site.

Felix Rose-Collins

Felix Rose-Collins

Co-founder

Felix Rose-Collins is the Co-founder of Ranktracker, With over 10 years SEO Experience . He's in charge of all content on the SEO Guide & Blog, you will also find him managing the support chat on the Ranktracker App.

Comments

Try Ranktracker for FREE