Manage 301 and 404 redirections with these different ways.
Create a global redirect
1. To create a global redirect, head to SEO > PRO > Redirections / 404 tab.
2. Check the iOS radio button associated with ‘Redirections’.
3. Refresh your page and a new custom post type called ‘Redirections’ should now be available on your left menu.
4. Click ‘Add redirection’ under ‘Redirections’ custom post type.
5. Add your URL in the title field (eg: 'my-custom-permalink') without your domain name and any slash (/).
If you have a permalink structure like ‘/%category%/%postname%/’, include the categories: ‘category/sub-category/my-custom-permalink’.
From the SEO metabox:
1. Check 'Enable redirection'.
2. Choose a redirection type.
3. Select a login status.
4. Set a new URL (must be in absolute, eg., 'https://example.com/test').
5. Click Publish.
Create a redirect from an existing post
1. If you want to redirect a post, page, or post type, you can do that directly from post-screen editing via the SEO Metabox > Redirection tab.
2. Enter your redirect URL in absolute, check Enable Redirection, and choose 301 as a type.
3. Save your post and clear your cache if necessary.
Advanced settings for redirects
Regular expressions
1. To use a regular expression (Regex) in the origin URL, make sure to check the ‘Regex?’ option from the SEO Metabox > Redirection tab (see screenshot).
2. Enter your regex in the origin URL field (ie., post title).
We strongly suggest using a regex online tester to help you, such as: https://regex101.com/.
Regular expressions are extremely powerful but when misused, they can have disastrous effects on your URLs — and therefore your SEO. Test, test, and test!
For example, you want to redirect all your product pages like:
https://example.com/product/my-singular-product-page
https://example.com/product/another-singular-product-page
To a new permastructure like:
https://example.com/shop/my-singular-product-page
https://example.com/shop/another-singular-product-page
Simply enter this a source URL:
^/product/(.*)
And in the URL redirection field:
https://example.com/shop/$1
$1 matches the first captured group in your regex, ie, (.*)
Connection status as a condition
1. If you want to run a redirect based on the connection status of your visitor, click on the ‘Select a login status’ list and choose between 3 options:
- Only Logged In
- Only Not Logged In
- All (default)
For example, if you have an e-commerce site and you want to redirect your clients only if they are logged in to their account, you can.
Automatic redirects on post deletion / slug change
SEOPress can automatically alert you as soon as a URL is modified or deleted to create a redirection from the old URL to the new one easily.
1. Make sure the option 'Disable notifications on slug changes or post/term deletions' is not unchecked from the SEO > PRO > Redirections / 404 tab.
2. Edit the permalink, save your post, and return to the post type list to see the notice.
3. Click the ‘Create a redirection’ button, check all the pre-filled fields, and click Publish.
My redirect doesn’t work!
1. Clear your 404 errors via SEO > Tools > Redirections tab > Clean your 404 section, and click the ‘Delete all 404’ button.
2. You may also try to clear your browser cache.
3. If it still doesn’t work, check and make sure that the checkbox ‘Enable redirection’ is ticked.
Should you still be experiencing this issue, please open a support ticket so we can assist you.