• Resolved Eric Hepperle

    (@codeslayer2010)


    Loving the Redirection plugin, but having some challenges. We are trying to redirect all version of the URL to lowercase.

    For example, these paths,

    /guests/
    /guests
    /Guests
    /GUESts

    should all redirect to
    https://elijahstre1stg.wpenginepowered.com/guests/

    However, achieving this seems like a real moving target – every time I think I’ve gotten this tested and working, I try it again and its not working. Sometimes it doesn’t work and gives me a white page that says “This page isn’t working”. Other times, it get stuck in an infinite redirection loop.

    According to regex101 my regex should work (had to add escape slashes, but removed in Redirection):

    I tried that in my redirect and it did not work. I then tweaked it until I had something that worked. The final result I have is this:

    SOURCE URL: ^/(?i)guests/?$
    DESTINATION URL: https://elijahstre1stg.wpenginepowered.com/guests/

    I have “Ignore Case” and “Regex” enabled. My regex should match whether or not there is a slash on the end by /?$

    https://prnt.sc/tgwONI3nKKn0

    How do I get this working?

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author John Godley

    (@johnny5)

    Redirection uses PHP for regular expressions, so whatever features you use need to be supported by PHP. I don’t know if (?i) is compatible with PHP.

    Does it not work as a plain redirect with the ignore case and ignore trailing slash options?

    Personally unless you have very specific needs I would avoid redirecting different case versions of a URL. The canonical setting will take care of this, and WordPress itself does not bother performing a redirect, so it’s generally not worth the difficulty.

Viewing 1 replies (of 1 total)
  • The topic ‘Make all URLS with or without “/” slash redirect to lowercase’ is closed to new replies.