Score:0

Having trouble getting a regex to redirect traffic to work correctly

it flag

I'm trying to setup some 301 redirects on WPengine using regex and I'm having trouble getting things working.

For pages that do not have the first part of the URL matching, I'm able to setup things up using the below:

  • Source: ^/abc/123/
  • Destination: ^/def/

However, when I set this up using the Old/New URL listeded above, this creates a circular reference so it does not work.

I'm trying to figure out how to create a regex expression that tells does not redirect the URL for /abc to itself, creating a circular direction.

The documentation from WPengine for this is here: https://wpengine.com/support/regex/

I've tried a bunch of different things and can't quite figure this one out.

Any help would be greatly appreciated...thank you!

Score:0
it flag

Figured it out - adding the solution for anybody who may need it in the future!

  • Source: ^/abc/(.+)
  • Destination: ^/abc/
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.