Redirection with regex doesn’t work

#636645
  • Resolved Tom Andrieu
    Rank Math free

    Hello, i’m trying to translate my .htaccess redirection in rankmath plugin.

    Here the current .htaccess that work well:


    RewriteCond %{QUERY_STRING} ^keywords=(.*)
    RewriteRule ^(events|spot|shops|classes)/?$ /explore?type=$1&keywords=%1 [R=301,L]

    And here what i’m putting in rank math:

    Regex: \/(events|spot|shops|classes)\/?\?keywords=(.*)
    Destination: /explore?type=$1&keywords=$2

    I have tried different regex like:

    ^(events|spot|shops|classes)\/\?keywords=(.*)
    ^(events|spot|shops|classes)\/?\?keywords=(.*)

    But they doesn’t work either

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for your query and we are so sorry about the trouble this must have caused.

    The Regex expressions inside an Apache configuration file don’t follow the same structure that we follow for our Regex which is for the PHP programming language.

    Can you please share a couple of example pages that you are trying to target with this type of redirection and what is the expected destination of those so we can advise further?

    Looking forward to hearing back from 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 1 replies (of 1 total)

The ticket ‘Redirection with regex doesn’t work’ is closed to new replies.