What is a 307 redirect and why is it important?

Through our SEO Agency Optimize 360
What is an SEO copywriter?

The 307 redirect, also known as the HTTP 307 Temporary Redirect, is an essential element of the web world. It allows web site administrators to direct users and search engines to a new page. URL in the event of a temporary change to the location of a page or resource.

In this article, we explore what a 307 redirect is, how it works, how it differs from other types of redirect and in what situations it can be used.

Redirection 307

1. What is the HTTP protocol?

HTTP (Hypertext Transfer Protocol) is the communication method used by the World Wide Web to transmit information between a web server and a browser. This protocol determines the rules to be followed for the exchange of information, in particular the codes used to signal various types of redirectors.

2. The different types of redirection

There are several types of redirections, each with a different meaning:

  • 301 Moved Permanently : The requested resource has been definitively moved to another URL.
  • 302 Found : This redirection indicates that the requested resource has been found on another URL, but may return to the original URL at a later date.
  • 303 See Other : Used to avoid double form submissions, this redirection asks the client to retrieve the resource using a GET method rather than a POST method.
  • 307 Temporary Redirect : Redirect 307 informs us that the resource has been moved temporarily and that it should return to the original URL shortly.

3. How redirects work 307

When a user or search engine attempts to access a URL that has been redirected with a 307 redirect, the server returns an HTTP response informing the client that the requested resource is now located at another URL. The browser then displays the new URL and retrieves the page content from this new location.

4. Why use a 307 redirect?

A 307 redirect can be useful in a number of situations:

  • Maintenance from website If you need to carry out maintenance work on your site and want to warn visitors and search engines, you can create a temporary page with a link to it and use a 307 redirect to direct visitors and search engines to the temporary page. indexing robots to this page.
  • Temporary relocation: If you are working on a new design for your website or if you are temporarily changing the domain nameYou can use a 307 redirect to redirect users and search engines to the new URL.
  • Testing new pages or features: You can use a 307 redirect to test new pages or features for a limited number of users, while maintaining the original URL for other users.

5. 307 versus 301 redirection: the key differences

Although both 307 and 301 redirects are used to redirect users to a new URL, they differ in a few crucial respects:

  • Temporary vs Permanent : The main difference is that a 307 redirect is temporary, whereas a 301 redirect is permanent. Search engines will understand that 307 redirects are temporary and will continue to index the original page, whereas they will gradually remove the old indexed URL when they detect a 301 redirect.
  • HTTP methods : Another difference comes from the HTTP methods supported. The 307 redirect maintains the HTTP method (GET or POST) used to access the resource when switching to the new URL, whereas a 301 redirect will always convert a POST method to GET.

6. 307 redirection and SEO

Correct management of redirects is essential for good SEO. Here's how 307 redirects can impact your SEO:

  • When a 307 redirect is set up, the search engines continue to index the original URL and do not grant their "authority" to the new URL as they would with a 301 redirect.
  • As a result, the new URL will not inherit the link juice (authority) or other ranking factors associated with the original URL.

7. How to set up a redirect 307

There are several ways of implementing a 307 redirect:

  1. .htaccess : Add the following directive to your .htaccess file: "Redirect 307 /old-url /new-url". Replace the appropriate URL values and ensure that the file is uploaded to your server.
  2. PHP : You can use a PHP script to redirect users with a 307 redirect by adding this line to your code: " header ('HTTP/1.1 307 Temporary Redirect'); header('Location : /new-url');
  3. JavaScript : To implement a 307 redirect via JavaScript, you can add this snippet code HTML to your web page: " ". The value '0' indicates the delay before redirection, in this case immediately.

8. Potential errors linked to redirections 307

Making mistakes when implementing redirects can have a detrimental effect on the performance of your website and its SEO. Here are some common mistakes and how to avoid them:

  • Use a 307 redirect instead of the appropriate redirect (301, 302 or 303), which can have an impact on the way search engines index your pages.
  • Create chain redirections, i.e. redirect one URL to another that is also redirected. Multiple redirects can slow down page loading and have a negative impact on your SEO.

9. Monitor 307 redirects and their impact

To ensure that your redirections are correctly configured and that they do not affect the performance of your website, it is important to regularly monitor their operation and their impact on SEO. Tools such as Google Search Console or third-party applications to check the status of redirections on your site.

10. When not to use a redirect 307

There are certain situations where it is preferable to avoid using a 307 redirect:

  • If you want to move a page or resource permanently to a new URL, it's best to use a 301 redirect to inform the search engines of the permanent change.
  • In cases where you only need to redirect certain types of request or if you want to specify other parameters, it may be more appropriate to use other redirection methods, such as rule-based redirection with tools such as mod_rewrite.
blank Digital Performance Accelerator for SMEs