Bug #101739
closedRedirects module: regexp enabled, respect get param ignored
100%
Description
I need a redirect if no query parameters are present:
/^\/foobar$/ with regexp enabled and "Respect GET Parameters" enabled
should only redirect to target if /foobar is present, but not /foobar?param=data
Do I misunderstood the redirect handling / wrong regexp in this case or is this a bug?
Updated by Stefan Bürk about 1 year ago
For RegEXP redirects the option "Respect GET Parameters" defines,
if the request uri is matched with the get parameters or without
against the defined RegEXP pattern.
REQUEST: https://domain.tld/foobar?param1&value=1
PATTERN: /^\/foobar$/
With "Respect GET Parameters" enabled the request path with query parameters
is matched against the defined pattern, and therefor do not match.
With "Respect GET PArameters" disabled only the path is used to match against
the RegExp pattern and would match ignoring GET parameters completly.
That means, you have to provide a regexp pattern matching also query parameters
if you want to match on specific query parameters only.
So to say, if I understand your description correctly I would say your assumption
is correct.
I could not reproduce this failing and I also created a patch adding tests to
cover exactly these cases to show that it's working.
If you are still getting redirects, you should check the redirect headers - they
should contain a 'X-Redirect-By' header entry with a value like 'TYPO3 Redirect 123',
where the integer value is the uid of the ext:redirects redirect record.
If you had originally other settings, maybe clear the TYPO3 caches AND the browser
caches (as 301 redirects may be cached by the browser for a while). Better check with
curl or something like that.
If you grap the redirect uid from the header you can see if the redirect you have in
mind is really the one doing the redirect or if it is another rule.
Question:
Can it be, that you have a redirect (regexp, plain) that handles /foobar but with
Respect GET Parameters disabled ?
Updated by Stefan Bürk about 1 year ago
And in the case of the example, have you tried to use non-regexp redirects ?
Updated by Gerrit Code Review about 1 year ago
- Status changed from New to Under Review
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80870
Updated by Gerrit Code Review about 1 year ago
Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80870
Updated by Gerrit Code Review about 1 year ago
Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80870
Updated by Gerrit Code Review about 1 year ago
Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80870
Updated by Gerrit Code Review about 1 year ago
Patch set 6 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80870
Updated by Gerrit Code Review about 1 year ago
Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80848
Updated by Gerrit Code Review about 1 year ago
Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/80886
Updated by Stefan Bürk about 1 year ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 75e9c23b5a0d4d97a7f3d83e341e9bbb028b0ead.