When should you do a URL redirection ? What different redirects exist (300, 301, 304…) and which one should be applied depending on your situation? Answer in this article.
What is a URL redirect?
A URL redirection is a mechanism that automatically sends an internet user (and search engines) from one web address to another. It is used when a page has changed address, has been deleted, or has been merged with another. For example, if you move a blog post, the redirect prevents visitors from landing on an error page (404). In SEO, it is an essential practice to preserve search rankings and transfer the authority of the old page to the new one. The most common redirects are 301 (permanent) and 302 (temporary), depending on whether the change of address is permanent or not.
Although this practice is very useful, it can sometimes be complex to implement. Indeed, there are several types of URL redirects and you need to choose the correct one, adapted to your situation, so as not to degrade the user experience or your organic search ranking.
What different URL redirects exist?
There are several types of URL redirects, each serving a specific purpose depending on the context and the objective sought. Here they are:
- 301 redirect (permanent) indicates the page has been moved permanently to a new address. It transfers almost all of the SEO value from the old page to the new one and should be used when changing a URL permanently.
- 302 redirect (temporary) signals that the move is only provisional — useful, for example, during a redesign or a page test.
- 307 redirect(the more recent one) replaces the 302 in modern protocols (HTTP/1.1) and preserves the request methods.
- Meta refresh redirect, executed client-side in the browser after a few seconds, but not recommended for SEO.
- Canonical tag : is not a redirect strictly speaking, but it tells search engines which version of a page should be considered the primary one to avoid duplicate content.
When to use a URL redirect?
A URL redirection can be used in many situations you will likely face one day. Among the most common are the following.
Changing the domain name
When your domain name is too long or is no longer representative of your activity, you are often forced to change it.
A URL redirection is necessary to send users who land on your old site to your new site.
Access to the same web page via different URLs
When the same content is accessible via different URLs, this creates content duplication, which is very bad for your SEO. This is often the case for a site's homepage.

Suppose your homepage can be visited via three URLs: URL A, URL B and URL C. Thanks to a redirect, you can, for example, send all users who arrive on URLs B and C to URL A. This tells Google which page should be indexed and gives that page more authority.
Modifying URLs
Changing a URL can be useful when updating your site and modifying your URL structure. Take an e-commerce site as an example: your product titled "tasse de thé" is accessible via the following URL: www.monsite.com/categorie/vaisselle/tasse-de-the.
If you decide to remove the "categorie" directory to simplify and shorten your URLs, your product will then be accessible via www.monsite.com/vaisselle/tasse-de-the.
If you don't create a redirect, it's likely that users will encounter a 404 error when clicking the old URL. This can happen if a third-party site has linked linked to your product before the change made to your URLs.
Access to a multilingual site
If you operate internationally and you own your site in different languagessite, you can create URL redirects. These allow displaying the correct version of the content to users depending on their geographic location.
URL redirects can also be set up if you merge two websites, delete a web page, or if you no longer want to use the "www" (or vice versa).
The main types of URL redirects
There are two types of URL redirection:
- Client-side redirect;
- Server-side redirect.
The latter is executed by a server as its name indicates, while the former is carried out directly by the "client", most often the user's browser.
Server-side redirects
Server-side redirects are the most common. For a user to be redirected to a URL, an HTTP request is made to the web server. The server then returns an HTTP status code that specifies the redirect to perform.
The status code corresponds to the name of the redirects. These can be temporary or permanent.
| HTTP status code | Redirection | Temporary or permanent |
| 301 | 301 redirect | Permanent |
| 302 | 302 redirect | Temporary |
| 307 | 307 Redirect | Temporary |
Client-side redirects
If these redirects are used less often, it is notably because they have several drawbacks in terms of SEO. To name just one, search engines do not always notice client-side redirects and when they do, the authority of the old web page is not transferred to the new one.
However, it is good to know the two types of client-side redirects:
- The Meta refresh : it automatically redirects the user to another URL after a delay, such as after an online payment;
- JavaScript redirect : it instructs the browser, via JavaScript code, to load another URL
Which URL redirect should you choose?
There are several types of redirects. Find out which type to choose depending on the different situations you may encounter.
301 redirect
This is certainly the most commonly used URL redirect for redirecting pages. You should implement it if you want to permanently redirect users who land on a page that has been deleted or moved, or whose permalink structure has been changed.
The 301 code tells Google several things:
- The page in question is no longer available at this URL;
- The page should no longer be indexed;
- The link juice from the old page must be transferred to the new one.
So you understand that a 301 redirect allows you to retain the authority of your old page.
Warning: Before implementing such a redirect, make sure your old URL will no longer be used, because it will be difficult to revert.
To set up a redirect between two pages, open your .htaccess file and insert the following code:
Redirect 301 /ancienne-page https://example.com/nouvelle-pageAlternatively, you can insert the following PHP code into the HTML source of the page to be redirected (in the <head> section):
header("Location: https://example.com/nouvelle-page", true, 301);
exit();For more complex cases, hire a qualified freelance developerModifying the .htaccess file should not be taken lightly. Indeed, in case of an error, it can cause significant damage to your site.
Regarding WordPress, there are free plugins plugins available to redirect pages.
302 redirect
This temporary redirect indicates that the content has been found but is currently located at another URL. You can therefore temporarily redirect visitors to that other web page.
Originally, the 302 redirect did not involve any transfer of authority, which explains why it was so rarely used. But today, that seems to have changed.
You can use it when the content of URL A has been temporarily moved to URL B, or when you want to redirect your visitors to the correct language version of your site.
As with a 301 redirect, you can implement a 302 redirect via the source code of the page to be redirected or directly from the .htaccess file. In the first case, insert the following PHP code:
header("Location: https://example.com/nouvelle-page", true, 302);
exit();You can also edit the .htaccess file to create a 302 redirect between two pages:
Redirect 302 /ancienne-page https://example.com/nouvelle-page307 redirect
While the 302 redirect is more ambiguous, the 307 redirect clearly indicates that URL A has been moved for a short period. This redirect should be used if, for example, your site is under maintenance.
Because it is a temporary redirect, search engines do not transfer the authority of the old URL.
As with the 302 redirect, you can indicate it in PHP:
header("Location: https://example.com/nouvelle-page", true, 307);
exit();or by modifying the .htaccess file:
Redirect 307 /ancienne-page https://example.com/nouvelle-pageRedirects should be used in specific cases and sparingly. To ensure they are relevant and do not negatively affect your SEO, take the time to analyze your situation to choose the correct redirect to perform.
How to easily create a URL redirect on WordPress?
On WordPress, there are several ways to create a URL redirect to avoid 404 errors and preserve SEO. The simplest method is to use a dedicated plugin, such as Redirection or Yoast SEO Premium, which make it easy to configure 301 or 302 redirects without touching the code.
For more advanced users, it is also possible to create a redirect directly via the .htaccess file (for Apache servers) or via rewrite rules on Nginx, by adding the corresponding line for the source URL and the target URL. Finally, WordPress also offers a native “redirect URL” feature in some themes or SEO plugins, allowing you to redirect a page or post to a new address quickly and easily.
If you prefer to entrust this task to an expert, don’t hesitate to hire a WordPress developerThis professional will know how to configure your redirects properly, optimize your performance, and avoid any technical errors that could impact your search rankings.