-
-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable strip query string for regex or selectable per redirection #184
Comments
We can't reliably strip a query string from a regex match, because the Also yes, it would break backwards compatibility. You can come up with a RegEx that will match everything up to the next |
My ideas was not to strip query string from Regex it was to disable the option of adding (appending) them to the URL for certain redirects. Global Settings: Strip Query String from 404s
It would impact this if, where you can check the value for each redirection individually. craft-retour/src/services/Redirects.php Lines 251 to 256 in 2b006a4
Thinking about the solution with regex you wrote that might not be possible. Because you are appending the query string and if I append the anchor the query string will always come after the anchor which is not valid.
Making this impossible to achieve. This is way I would like to Enable stripping per route. Because in most cases I don't need it but in (almost all) regex cases I do need it. |
Ah I see, sorry I misunderstood. So you want that option to have a per-redirect override, essentially? |
Exactly. |
Would love something like this as well, would be very handy to pass around UTM tags etc. from a marketing perspective |
+1 |
Is your feature request related to a problem? Please describe.
If you have a
regexmatch
you usually get the whole match. For example:/old(.*)
/new$1
This would essentially remap all requests from
old
. The "problem" is if you have Strip Query String from 404s turned off, which usually is the case, you would get duplicate query string.Describe the solution you would like
There are essentially three solution that come to mind at the moment:
Describe alternatives you have considered
The idea was to maybe capture everything up till the
?
but that maybe problematic if there are anchors.([^?]+)
e.The text was updated successfully, but these errors were encountered: