• Resolved darrenc66

    (@darrenc66)


    I had a conversation with AI, explained that I’m using WordPress Redirection pugin, that I’m using the following redirects: ^/(.*?)/amp/$ – ^/(.*?)/\?wpamp$ – ^/(.*?)/amp$ and that the target url for each is mywebsite.com/$1/

    But that Google Search Console reports issues of urls with no trailing slash, extra trailing slashes, and sometimes cases of mywebsite.com/my-post/amp/?wpamp

    AI suggested the following regex: ^/(.*?)/amp/?(\?wpamp)?$ to replace the 3 original redirects and that all cases of /amp/, /amp, /?wpamp, and /amp/?wpamp will redirect to mywebsite.com/my-post/ as expected.

    Im not looking for a solution, just a hint. I have not tested it yet as I often find everything apparently works ok when testing, only for GSC to report errors a few days later.

    So would just like to know if there is any obvious potential issue with that regex. Thanks

    • This topic was modified 11 months ago by darrenc66.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author John Godley

    (@johnny5)

    I have not tested it yet as I often find everything apparently works ok when testing, only for GSC to report errors a few days later.

    The only way to know is to test and experiment, and that’s what I would have to do myself. You can test directly in the plugin, or in a regex tester. It can take Google months before updates are fully detected, so you’ll need to monitor things and adjust the expression to handle whatever exceptions come up.

    Thread Starter darrenc66

    (@darrenc66)

    OK, will give it a go. Thanks John.

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

The topic ‘Could This Regex Work?’ is closed to new replies.