A redirection makes it possible to automatically redirect an internet user arrived on an U URL A (or web page A) to a B URL (or web page B) without it noticing it.
If this practice is very useful, it sometimes remains complex to achieve. There are indeed several types of URL redirection and you should choose the right one, that adapted to your situation, so as not to degrade the user experience or your natural referencing.
In this article we will tell you everything about the URL redirects : in which cases to use them? For what ? And above all, which one use and how?
When to use an URL redirection?
An URL redirect can be used according to many situations that you will certainly face one day.
Among the most common, we can cite the following.
Domain name change
When your domain name is too long or is no longer representative of your activity you are often forced to change it.
An URL redirection is necessary to redirect Internet users who fall 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 from Duplicate contentwhich is very bad for your SEO. This is often the case for the home page of a site.


Let us admit that your home page can be visited via three URLs: URL A, URL B and URL C. Thanks to a redirection you can for example redirect all users who arrive on URL B and C to URL A. This indicates to Google the page which must be indexed and gives more authority to the latter.
The modification of URLs
This can happen when you update your site and touch the structure of your URL.
Take the example of an e-commerce site: your product entitled “Tea of tea” is accessible via the following URL: www.monsite.com/categorie/vaisselle/tasse-de-ethe.
If you decide to remove the “Category” directory to simplify and reduce the length of your URL, your product will then be accessible via www.monsite.com/vaisselle/tasse-de–the.
If you do not create redirection it is likely that Internet users will come across a Error 404 By clicking on the old URL. This can happen if a third -party site has link Your product before the change made on your URL.
Access to a multilingual site
If you carry out your activity internationally and have your Site in different languagesyou can create URL redirects. These allow internet users to display the right version of the content according to their geographical position.
URL redirects can also be implemented if you merger two websites, if you delete a web page or if you no longer want to use the “www” (or vice versa).
The main types of URL redirect
There are two types of URL redirection:
- Redirection on the customer side
- Redirection on the server side
The latter is executed by a server as its name suggests, while the first is made directly by the “customer”, very often the user browser.
Redirects on the server side
These are the most common.
For a surfer to be redirected to an URL, an HTTP request is made to the web server. The latter then delivers a HTTP status code which specifies the redirection to be carried out.
The status code corresponds to the name of the redirects. These can be temporary or permanent.
HTTP status code | Redirection | Temporary or permanent |
301 | Redirection 301 | Permanent |
302 | Redirection 302 | Temporary |
307 | Redirection 307 | Temporary |
Redirects on the customer side
If these redirections are less used it is notably because they have several drawbacks in terms of SEO.
To name a one, the search engines do not always notice the redirects on the customer side and when this happens, the authority of the old web page is not transferred to the news.
Nevertheless, it is good to know the two types of redirection on the customer side:
- META REFRESH : It indicates the browser to refresh the web page or redirect the user to another URL after a certain period. You have certainly encountered this situation after making an online payment.
- JavaScript redirection : she asks the browser, via JavaScript code, to load another URL
What URL redirection to choose?
There are several types of redirects. Find out which type to choose according to the different situations you can meet.
Redirection 301
It is certainly the most used URL redirection to redirect pages.
You must set up it if you want to permanently redirect users who arrive on a page that has been deleted or moved, or for which the permalian structure has been changed.
Code 301 indicates several things to Google:
- The page in question is no longer available for this URL
- The page should no longer be indexed
- The link juice of the old page must be transferred to the new
You therefore understand that a 301 redirection allows you to keep the authority of your old page: all your SEO efforts are kept.
Please note: before setting up such a redirection make sure that your old URL will no longer be used because you can hardly go back.
To set up a redirection between two pages Open your .htaccess file and insert the following code:
Redirect 301 /ancienne-page https://example.com/nouvelle-page
Another solution, you can insert in the HTML source code of the page to be redirected (section
) The following PHP code:
header("Location: https://example.com/nouvelle-page", true, 301);
exit();
For more complex cases, call on a qualified professional. The modification of the .htaccess file should not be taken lightly because in the event of an error this can cause damage to your site.
On WordPress, Free plugins exist to redirect the pages.
Redirection 302
This temporary redirection indicates that the content has been found but that it is currently on another URL. You can therefore temporarily redirect visitors to this other web page.
Originally, redirection 302 did not involve any transfer of authority which explains why it is so little used, but today the situation seems to have changed.
You can use it when the content of an URL A has been temporarily moved to a B URL, or when you want to redirect your visitors to the right linguistic version of your site.
As for redirection 301, you can perform a 302 redirection 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 change the .htaccess file to make a 302 redirection between two pages:
Redirect 302 /ancienne-page https://example.com/nouvelle-page
Redirection 307
While redirection 302 is more ambiguous, redirect 307 clearly indicates that URL A has been moved for a short time.
This redirection is to be used if your site is in maintenance for example.
Since it is a temporary redirection, search engines do not take into account the authority of the old URL.
As for redirection 302, you can indicate it in PHP:
header("Location: https://example.com/nouvelle-page", true, 307);
exit();
or by modifying the .htacess file:
Redirect 307 /ancienne-page https://example.com/nouvelle-page
Redirects must be used in very specific cases and sparingly. In order for them to be relevant and have no negative impact on your SEO, take the time to analyze your situation to choose the right redirection has done.
Discover our step by step tutorial to make an URL redirect with WordPress.