Types of Redirects. Htaccess Redirect Tips and Tricks

Posted on October 28th, 2016

301 Redirect

This is a permanent redirect and is used to indicate to search engines that the originating URL has permanently moved to a new URL. 301 refers to the HTTP status code for this type of redirect and it is the best method for implementing redirects on a website.  It acts as the most efficient and search engine friendly method for webpage redirection.


Redirect to www using htaccess redirect

    RewriteEngine on

rewritecond %{http_host} ^domain.com [nc]

rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]

Replace domain.com with your domain name.


301 redirects can be used in the following circumstances

1) Move site to a new domain and to make the transition as seamless as possible.

2) Merging two websites and want to make sure that links to outdated URLs are redirected to the correct pages.

3) People access your site through several different URLs.


302 Redirect

302 redirect is a temporary redirect. This is useful for SEO purposes when you have a temporary landing page and plan to switch back to your main landing page at a later date.


302 redirects can be used in the following circumstances

1) A/B testing of a web page for functionality or design.

2) Getting client feedback on a new page without impacting site ranking.

3) Updating a web page while providing viewers with a consistent experience.


Redirect www.example.com to http://test.example.com using 302 redirect rule

RewriteEngine On

RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]

RewriteRule ^(.*)$ http://test.example.com/ [L,R=302]


303 Redirect

303 redirect uses GET method to retrieve. This is basically telling the server to use a specific method to fetch the information on the server. 303 redirect was used to prevent a form re-submission after an HTTP Post request. With a 303 redirect, if someone bookmarks the page, it will send them to a page that says something such as “Data submitted successfully,” instead of showing them the data you submitted.


303 redirects can be used in the following circumstances

1) Geotargeting

2) Device targeting

3) A/B Testing

4) Tracking

5) Recurring temporary content.

6) Redirect with no effect to presence in search results.


307 Redirect

307 Temporary Redirect is almost exactly the same as a 303 redirect and this is not cacheable by default. The 307 redirect can be used if you need a temporary redirect, which forces the client to preserve the request method from the original request to the request on the destination URL. 307 redirects should not be used with the PRG-pattern. The 307 status code should also not be used if the redirect is of permanent nature.


308 Redirect

 A 308 redirect is cacheable by default, if not indicated otherwise. The 308 redirect is the wrong choice for all occasions in which catchability can leads to unexpected negative behavior. The 308 redirect can be used if it is required to use the request method from the original request for the subsequent request, e.g. redirect of form action URLs using the POST method.


308 redirects can be used in the following circumstances

1) Moving a very complex website with a lot of forms that use the POST method.

2) Subsequent request requires POST, e.g. moving a form action URL that requires the POST method.

3) Moving a domain permanently.

4) Moving a document permanently.

5) Changing the sites protocol permanently.

6) Changing a site’s structure permanently.


If you need any further assistance please contact our support department.



Leave a Reply