Help managing permalinks in Rankmath server on HostJane

#1086024
  • Resolved soz.stays2
    Rank Math free

    I’m using RankMath on a managed WordPress server on HostJane AWS – https://www.hostjane.com to manage our SEO with a custom post type ‘events’ and a dynamic taxonomy ‘event-category.’

    After updating to a new permalink structure (/events/%event-category%/%postname%/), I need to redirect old URLs (/event/%postname%/) to the new structure using RankMath’s regex redirect feature.

    However, my regex pattern /^event\/(.+)/ to /events/$1/%postname%/ is incorrectly mapping the event category, causing 404 errors for some posts and breaking dynamic archive pages.

    How can I craft a regex pattern in RankMath that correctly captures the post name and dynamically assigns the corresponding event category in the redirect while preserving archive page functionality?

    Also, HostJane is using AWS EC2 servers to host Rankmath (https://cloud.hostjane.com/wordpress) and I am concerned a bit that there is some kind of security group conflict happening with my WordPress set up but will persist and see how it goes if I can fix this regex problem. Would AWS interfere with regex permalinks?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello,

    I apologize for the issue you are facing with managing permalinks and redirects in Rank Math. Thank you for providing detailed information about your setup and the challenges you’re encountering.

    To create a regex pattern that correctly captures the post name and dynamically assigns the corresponding event category in your redirect, you can use the following regex:

    Source URL Regex:

    ^event/(.+)/

    This pattern captures everything after /event/ as the post name.

    Destination URL:

    events/$1/

    This will redirect to the new permalink structure while preserving the post name. However, since you want to include the event category dynamically, you will need to ensure that your event categories are properly set up in your WordPress installation.

    Unfortunately, regex alone cannot dynamically pull the event category from the old URL unless it is explicitly defined in the source URL. If your old URLs do not contain the event category, you may need to create separate redirects for each category or consider a different approach to handle this.

    Example of Redirecting with Event Category:

    If your old URLs included the event category, you could modify your regex like this:

    Source URL Regex:

    ^event/([^/]+)/([^/]+)

    This captures both the event category and post name.

    Destination URL:

    events/$1/$2/

    This way, $1 would represent the event category and $2 would represent the post name.

    Important Note:

    Make sure to test these regex patterns in a staging environment before applying them to your live site to avoid any potential issues.

    Regarding your concern about AWS EC2 servers and security groups, AWS itself does not interfere with regex permalinks. However, ensure that your server’s security settings allow for proper URL rewriting and that there are no conflicts with other plugins or server configurations that might affect how permalinks are processed.

    If you continue to experience issues or if this solution does not resolve your problem, please reply to this ticket with your site URL so that a human agent from our support team can assist you further. We’re here to help!

    Sources:
    How to Redirect Posts After Changing URLs » Rank Math
    Solving Redirection Issues Using Rank Math SEO Plugin » Rank Math
    WordPress Permalink Structure & Changing Individual URLs » Rank Math

    Hello,

    Unfortunately, this redirection can’t be achieved with the regex redirection.

    You’ll have to add the redirections manually for all of your pages in the Rank Math Redirection.

    Alternatively, in the PRO version of the Rank Math plugin, you can use the CSV method to add redirections in bulk: https://rankmath.com/kb/how-to-manage-redirects-via-csv/

    Hope that helps, and please don’t hesitate to let us know if you have any other questions.

    Thank you.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)

The ticket ‘Help managing permalinks in Rankmath server on HostJane’ is closed to new replies.