Too many redirects using regular expressions on encoded URLs
-
Hi!
I’m currently relaunching a shop system and have some problems using your plugin to redirect old URLs to new ones.
Having this kind of product URLs on the old typo3 page:
/products/detail/?tx_commerce_pi1%5BshowUid%5D=5455&tx_commerce_pi1%5BcatUid%5D=&tx_commerce_pi1%5BbasketHashValue%5D=1b0bfa5f62&cHash=9f290e8ea8c95878f2a18e6e6521d997
I need to match the
tx_commerce_pi1[showUid]=5455
parameter to redirect to something like
/products/product-title
.My regex redirect rule looks like this:
^(/products/detail/\?tx_commerce_pi1\[showUid\]=5455)(.*?)$
If I try using the non encoded URL
/products/detail/?tx_commerce_pi1[showUid]=5455
it works fine, but using the encoded URL
/products/detail/?tx_commerce_pi1%5BshowUid%5D=5455
I get a “too many redirects error”.I’ve tried to get more infos using
curl -L -v "https://staging.xxxxxxxx.de/products/detail/?tx_commerce_pi1%5BshowUid%5D=5455"
getting this output, but don’t get the error…
* Trying 46.252.27.XXX...
* TCP_NODELAY set
* Connected to staging.xxxxxxxxxxx.de (46.252.27.XXX) port 80 (#0)
> GET /products/detail/?tx_commerce_pi1%5BshowUid%5D=5455 HTTP/1.1
> Host: staging.xxxxxxxxxxx.de
> User-Agent: curl/7.64.1
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Date: Wed, 09 Sep 2020 11:18:13 GMT
< Server: Apache/2.4.38 (Debian)
< Set-Cookie: agp-cookies-allow-thirdparty=0; expires=Fri, 08-Jan-2021 11:18:13 GMT; Max-Age=10454400; path=/
< Set-Cookie: agp-cookies-allow-statistics=0; expires=Fri, 08-Jan-2021 11:18:13 GMT; Max-Age=10454400; path=/
< Set-Cookie: agp-cookies-confirmed=0; expires=Fri, 08-Jan-2021 11:18:13 GMT; Max-Age=10454400; path=/
< Expires: Wed, 09 Sep 2020 12:18:14 GMT
< Cache-Control: max-age=3600
< X-Redirect-By: redirection
< Location: /products/detail/?tx_commerce_pi1%5BshowUid%5D=5455
< Content-Length: 0
< Content-Type: text/html; charset=UTF-8
<
* Connection #0 to host staging.xxxxxxxxxxx.de left intact
* Issue another request to this URL: 'https://staging.xxxxxxxxxxx.de/products/detail/?tx_commerce_pi1%5BshowUid%5D=5455'
* Found bundle for host staging.xxxxxxxxxxx.de: 0x7f8f3cc187e0 [can pipeline]
* Could pipeline, but not asked to!
* Re-using existing connection! (#0) with host staging.xxxxxxxxxxx.de
* Connected to staging.xxxxxxxxxxx.de (46.252.27.XXX) port 80 (#0)
> GET /products/detail/?tx_commerce_pi1%5BshowUid%5D=5455 HTTP/1.1
> Host: staging.xxxxxxxxxxx.de
> User-Agent: curl/7.64.1
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Date: Wed, 09 Sep 2020 11:18:14 GMT
< Server: Apache/2.4.38 (Debian)
< Set-Cookie: agp-cookies-allow-thirdparty=0; expires=Fri, 08-Jan-2021 11:18:14 GMT; Max-Age=10454400; path=/
< Set-Cookie: agp-cookies-allow-statistics=0; expires=Fri, 08-Jan-2021 11:18:14 GMT; Max-Age=10454400; path=/
< Set-Cookie: agp-cookies-confirmed=0; expires=Fri, 08-Jan-2021 11:18:14 GMT; Max-Age=10454400; path=/
< Expires: Wed, 09 Sep 2020 12:18:14 GMT
< Cache-Control: max-age=3600
< X-Redirect-By: redirection
< Location: /products/detail/?tx_commerce_pi1%5BshowUid%5D=5455
< Content-Length: 0
< Content-Type: text/html; charset=UTF-8
<
* Connection #0 to host staging.xxxxxxxxxxx.de left intact
* Issue another request to this URL: 'https://staging.xxxxxxxxxxx.de/products/detail/?tx_commerce_pi1%5BshowUid%5D=5455'
* Found bundle for host staging.xxxxxxxxxxx.de: 0x7f8f3cc187e0 [can pipeline]
* Could pipeline, but not asked to!
* Re-using existing connection! (#0) with host staging.xxxxxxxxxxx.de
* Connected to staging.xxxxxxxxxxx.de (46.252.27.XXX) port 80 (#0)
> GET /products/detail/?tx_commerce_pi1%5BshowUid%5D=5455 HTTP/1.1
> Host: staging.xxxxxxxxxxx.de
> User-Agent: curl/7.64.1
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
< Date: Wed, 09 Sep 2020 11:18:14 GMT
< Server: Apache/2.4.38 (Debian)
< Set-Cookie: agp-cookies-allow-thirdparty=0; expires=Fri, 08-Jan-2021 11:18:14 GMT; Max-Age=10454400; path=/
< Set-Cookie: agp-cookies-allow-statistics=0; expires=Fri, 08-Jan-2021 11:18:14 GMT; Max-Age=10454400; path=/
< Set-Cookie: agp-cookies-confirmed=0; expires=Fri, 08-Jan-2021 11:18:14 GMT; Max-Age=10454400; path=/
< Expires: Wed, 09 Sep 2020 12:18:14 GMT
< Cache-Control: max-age=3600
< X-Redirect-By: redirection
< Location: /products/detail/?tx_commerce_pi1%5BshowUid%5D=5455
< Content-Length: 0
< Content-Type: text/html; charset=UTF-8
...Looking forward to get any suggestions!
Cheers
Hendrik
- The topic ‘Too many redirects using regular expressions on encoded URLs’ is closed to new replies.