• Resolved Jhonny

    (@masterpiece8931)


    Hello, I created a redirect as follows:

    /*/settings/ to redirect to another page. (regex enabled)

    However, I have a page with /settings/notifications and I didn’t want the redirect to apply to it as well. And the redirect is working for her. What do I do?

    • This topic was modified 2 years, 1 month ago by Jhonny.
Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author John Godley

    (@johnny5)

    /*/settings/ is not a regular expression. You should read https://redirection.me/support/redirect-regular-expressions/ for more details about regular expressions.

    Thread Starter Jhonny

    (@masterpiece8931)

    I didn’t find any information that helps, how do I make terms after /settings/ not valid?

    Plugin Author John Godley

    (@johnny5)

    The are examples of regular expressions at the bottom of the page, along with references to guides and tools you can use.

    You will note in the examples that * is never on its own, and is usually something like .*. If you have a valid expression it may not match the other URL anyway.

    You can use https://regex101.com/ to test your expression is correct.

    Thread Starter Jhonny

    (@masterpiece8931)

    Right, John!

    But I think it has no options for me, I wanted some character that would make the regex only stick to /settings/ so my other URLs with /settings/notifications wouldn’t redirect. I tried /.*/settings/ but it didn’t work either…

    Very sad!

    Thank you for your help.

    • This reply was modified 2 years, 1 month ago by Jhonny.
    • This reply was modified 2 years, 1 month ago by Jhonny.
    Plugin Author John Godley

    (@johnny5)

    If all you want is /settings/ then just use that as a plain redirect with no regular expression.

    Thread Starter Jhonny

    (@masterpiece8931)

    My theme puts username before settings :/

    Like /jhonny2882/settings/

    • This reply was modified 2 years, 1 month ago by Jhonny.
    Plugin Author John Godley

    (@johnny5)

    Ok, it really helps to put accurate examples.

    My original statement still applies – if you have a valid regular expression then it won’t match /settings/notifications. /*/settings/ is not valid

    Thread Starter Jhonny

    (@masterpiece8931)

    /(.*)/settings/ is it a regular expression? Because it really redirects /username/settings well, the problem is that it is also valid for /settings/notifications/, is it an error on my server?

    • This reply was modified 2 years, 1 month ago by Jhonny.
    Plugin Author John Godley

    (@johnny5)

    Change .* to .+ and it should work

    Thread Starter Jhonny

    (@masterpiece8931)

    it didn’t, redirected to /my-account/notifications/ (this page doesn’t exist), the normal redirect was my-account and this happened when I tried /settings/notifications.

    Plugin Author John Godley

    (@johnny5)

    /settings/notifications is not redirected by the above expression. You may need to clear all of your caches.

    Thread Starter Jhonny

    (@masterpiece8931)

    So the correct expression is:/(.+)/settings/?

    Thread Starter Jhonny

    (@masterpiece8931)

    Hi, I sent an email to [email protected], did you receive it?

    Plugin Author John Godley

    (@johnny5)

    Yes. The information you sent is for another URL that hasn’t been mentioned before and isn’t /settings/notifications. I don’t know what you are trying to do, and it seems to keep changing.

    As mentioned on https://redirection.me/support/redirect-regular-expressions/ I don’t provide support for regular expressions. It’s something you need to do yourself. This thread is a good example of why I have that warning.

    I would suggest that you list out all the conditions that you are trying to match and not match and then use https://regex101.com to see how they match. That website will tell you why they match and you can then modify the expression. When you have something that’s a bit nearer I can provide some advice.

    Thread Starter Jhonny

    (@masterpiece8931)

    Hello John! Thank you so much for the guidance and support, I got it here!

    • This reply was modified 2 years, 1 month ago by Jhonny.
Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Help me, please’ is closed to new replies.