Hello,
We apologize for the issue you are facing with your URLs. Yes, it is possible to replace underscores with hyphens in your URLs using Rank Math by setting up a regex redirection.
Here’s how you can do it:
- Go to the Redirections section in Rank Math.
- Add a new redirection:
- In the Source URLs field, use the following regex pattern to match URLs with underscores:
^(.*)_(.*)$
- In the Destination URL field, use this pattern to replace underscores with hyphens:
$1-$2
- Click on the Add Redirection button to save your changes.
This setup will redirect any URL containing underscores to the same URL with hyphens instead.
For more detailed information on using regex for redirections, you can refer to our documentation here.
If you have any further questions or need assistance, please reply to this ticket, and a human agent from our support team will assist you further. Thank you for raising this concern!
Sources:
How to Redirect Posts After Changing URLs » Rank Math
How to Set Up Redirections » Rank Math
Hello,
It seems that you have already marked this as already resolved.
Could you please confirm?
Looking forward to helping you.