Help me, please
-
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 3 years, 8 months ago by
Jhonny.
-
This topic was modified 3 years, 8 months ago by
-
/*/settings/is not a regular expression. You should read https://redirection.me/support/redirect-regular-expressions/ for more details about regular expressions.I didn’t find any information that helps, how do I make terms after /settings/ not valid?
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.
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.
If all you want is
/settings/then just use that as a plain redirect with no regular expression.My theme puts username before settings :/
Like /jhonny2882/settings/
-
This reply was modified 3 years, 8 months ago by
Jhonny.
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/(.*)/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 3 years, 8 months ago by
Jhonny.
Change .* to .+ and it should work
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.
/settings/notificationsis not redirected by the above expression. You may need to clear all of your caches.So the correct expression is:/(.+)/settings/?
Hi, I sent an email to [email protected], did you receive it?
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.
Hello John! Thank you so much for the guidance and support, I got it here!
-
This reply was modified 3 years, 8 months ago by
Jhonny.
-
This reply was modified 3 years, 8 months ago by
The topic ‘Help me, please’ is closed to new replies.