There is a page redirect loop and the page won't open.
What a redirect is
Redirects are used to automatically route visitors from one page of a site to another. When a web server receives a request for an old URL (for example, /old-page/), it responds with a new URL (/new-page/).
When to use a redirect
Redirects come in handy when you want to change the URL of a page or delete one. To automatically route traffic to your new page, set up redirecting.
How to set up a redirect
Go to the Settings -> Redirects and click Add redirect.
In the Page field, enter the URL of an old page.
In the Redirect to field, enter the URL of a new page.
In the Type field, select the type of redirect: permanent, temporary or transparent.
Priority order
If several redirects are configured from one URL to several other URLs at once, the highest rule in the list will be executed first. To change the priority order, drag and drop the rule using the dots icon.
If several redirects are configured from one URL to several other URLs at once, the highest rule in the list will be executed first. To change the priority order, drag and drop the rule using the dots icon.
Types or redirect
301 permanent redirects
A 301 permanent redirect tells browsers that a page has been permanently moved to a different URL. The search engine ranking and other SEO parameters of the old page are preserved with the new page, which is good news for the site's ranking.
Imagine that you move to a new house and take all your favorite things with you. You also change your residential address and tell it to all your friends and family. On the door of your old house you leave a note with your new address to help everyone find you when they need it.
302 temporary redirects
A 302 temporary redirect tells browsers that your old page has temporarily changed its URL. Browsers understand that the old URL is still relevant, the search engine ranking and other SEO parameters are preserved with the old URL.
Imagine that you move to another city for several months, so you will receive your packages and mail at a new address. After getting back home, your correspondence will again be delivered at your residential address.
200 transparent redirects
With transparent redirects visitors are routed from the old page to a new page with a different URL, however, the URL in the address bar of the browser doesn't change. So your site's visitors do not notice the switch.
NOTE
You can set up transparent redirects only for your own domain. You cannot add a transparent redirect to a third-party website.
You can set up transparent redirects only for your own domain. You cannot add a transparent redirect to a third-party website.
Imagine that you come to a fast food restaurant and order a burger. The waiter sneaks to a neighboring restaurant and brings you a burger from there. To you, it looks like the restaurant where you are sitting has made your burger.
Simple redirects
If you need to set up routing from one page to another one, and your site has a simple structure, use standard redirects.
When to use:
1. Migration from an old URL /old-page/ to a new one /new-page/. In this case, browsers will redirect visitors to your new page.
2. Forwarding visitors from your old page /old-page/ to your Home page (/). In this case, browsers will redirect visitors to your site's Home page.
NOTE
In the Page field, you can only specify the domain of the current site, whereas in the Redirect to field, you can specify both the current domain or any other external domain.
In the Page field, you can only specify the domain of the current site, whereas in the Redirect to field, you can specify both the current domain or any other external domain.
Variables
Using one variable
The old structure of pages:
/phones/iphone13 |
/phones/iphone14 |
/phones/iphone15 |
Imagine you decide to reorganize your site's structure using different URLs. You need to redirect all pages with the /phones/ URL slugs to the /gadgets/ URL slugs.
In order not to create three individual redirects (for each separate page), you can use variables.
Variables are specified in braces, for example, {uri}.
You can enter any name instead of uri. Use lowercase Latin letters, numbers and underscore characters (_).
We've named the variable {model} to show the model of each gadget.
In this case, the traffic will be redirected from the old URLs to new URLs.
/gadgets/iphone13 |
/gadgets/iphone14 |
/gadgets/iphone15 |
You can leave the variable without a name. In this case, use the * character.
For example, add the following rule:
/phones/* | /gadgets/* |
This variable will work the same way as the {model} variable.
IMPORTANT
The rule applies only to the subpages. The redirect won't work for the /phones/ URL slug itself.
The rule applies only to the subpages. The redirect won't work for the /phones/ URL slug itself.
Using two variables
NOTE
In this case, you should use only named variables to make them different and recognizable for the browsers.
In this case, you should use only named variables to make them different and recognizable for the browsers.
Old page URL | New page URL |
---|---|
/lang/sp/category/phones/iphone13 | /lang-sp/category/phones/iphone13 |
Let's call our variables {language}and {model} to know what page the traffic will be routed to.
Page field value | Redirect to field value |
---|---|
/lang/{language}/category/{model}/ | /lang-{language}/category/{model}/ |
Examples of redirects
Old page URL (redirect from) | Page field value | Redirect to field value | New page URL (redirect to) |
---|---|---|---|
/old-page/ | /old-page/ | / | / |
/old-page/ | /old-page/ | /new-page/ | /new-page/ |
/phones/galaxy | /phones/{model}/ | /{model}/ | /galaxy/ |
/phones/iphone13 | /phones/{model} | /gadgets/{model} | /gadgets/iphone13 |
/lang/sp/category/phones/iphone13 | /lang/{language}/category/{model}/ | /lang-{language}/category/{model}/ | /lang-sp/category/phones/iphone13 |
Troubleshooting
My page doesn't redirect to an external site.
I'm trying to test the redirect in the editor but it doesn't work.