Hello,
I’m sorry to hear that you are facing issues with the redirects in Rank Math. Redirecting URLs that start with a question mark "?" can be a bit tricky due to how URLs are structured.
To properly redirect a URL that starts with a question mark, you need to use regular expressions (regex) in the redirection settings. Here’s how you can set up the redirect for your specific case:
-
In the Source URLs field, you should use the following regex pattern:
?page_id=1720
-
Select the Regex option in the Match Type dropdown menu.
-
In the Destination URL field, enter:
https://rankmath.com/wp-content/uploads/2021/06/rank-math-redirections.png
-
Save the redirection.
By using regex in the Source URLs field, you can accurately match and redirect URLs that start with a question mark. This should help resolve the issue you are experiencing with the redirect not working as expected.
If you encounter any further difficulties or need additional assistance, please feel free to reach out. Thank you for your understanding and patience while we work on resolving this redirect issue for you.
Warm regards.
Sources:
Solving Redirection Issues Using Rank Math SEO Plugin » Rank Math
How to Fix the Submitted URL Seems to Be a “Soft 404” Error » Rank Math
How to Redirect Posts After Changing URLs » Rank Math
When I do that, I get this error code and the website breaks.
Warning: Undefined array key “sources” in /var/www/wordpress/wp-content/plugins/seo-by-rank-math/includes/modules/redirections/class-redirection.php on line 217
Warning: foreach() argument must be of type array|object, null given in /var/www/wordpress/wp-content/plugins/seo-by-rank-math/includes/modules/redirections/class-redirection.php on line 217
Warning: Cannot modify header information – headers already sent by (output started at /var/www/wordpress/wp-content/plugins/seo-by-rank-math/includes/modules/redirections/class-redirection.php:217) in /var/www/wordpress/wp-includes/pluggable.php on line 1435
Warning: Cannot modify header information – headers already sent by (output started at /var/www/wordpress/wp-content/plugins/seo-by-rank-math/includes/modules/redirections/class-redirection.php:217) in /var/www/wordpress/wp-includes/pluggable.php on line 1438
Hello,
Apologies for the confusion.
Please note that the kind of redirect for queried/parameter URLs is available only in the Rank Math PRO version.
Those URLs have the question mark (?) at the beginning as we have explained here:
https://rankmath.com/kb/setting-up-redirections/#parameterized-url
Looking forward to helping you.
Hello,
We are glad to know that this issue has been resolved. Thank you for letting us know.
This ticket will be closed now, but you can always open a new one if you have any other questions or concerns. We are here to help you with anything related to Rank Math.
We appreciate your patience and cooperation throughout this process.
Thank you for choosing Rank Math.