Issue Bug Closed

#103171Redirect to file with "Force SSL Redirect" broken on iOS browsers

Thorsten May 02/21/24, 10:58 updated 12/02/25, 14:33

Description

When you create a redirect in the Redirects module that points to a file in fileadmin (t3://file?uid=xxx) and enable force_https, the resulting url looks like ‘https:/fileadmin/…’

Most browsers seem to handle this correctly and redirect to the chosen file, but iOS Browsers (Safari, Chrome) don’t add the domain an redirect to https://fileadmin/… what leads to an error.

Maybe a problem in /sysext/core/Classes/Http/RedirectResponse.php with setting $headers[‘location’] = [(string)$uri] or in /sysext/redirects/Classes/Http/Middleware/RedirectHandler.php where buildRedirectResponse is called.

Reviews 3

Files 2

History 610

  1. Chris Müller commented and changed status New Needs Feedback <span data-processor="relativetime" data-value="2024-02-21T18:02:40+00:00" > 02/21/24, 18:02 </span>

    Without looking deeper, how have you configured your site configuration? Is there “/” as base defined?

  2. Thorsten May commented <span data-processor="relativetime" data-value="2024-02-22T07:00:24+00:00" > 02/22/24, 07:00 </span>

    Chris Müller wrote in #note-1:
    > Without looking deeper, how have you configured your site configuration? Is there “/” as base defined?

    The base is a full domain. I tried in different installations and now also with TYPO3 Version 12. It’s the same behaviour there.

  3. Riccardo De Contardi commented <span data-processor="relativetime" data-value="2024-12-18T14:16:26+00:00" > 12/18/24, 14:16 </span>

    I think this is still true for both version 12 and 13; my test has been the following:

    TYPO3 config:

    Sites module

    Site configuration > Entry Point [base] : https://typo3.12.test.it.ddev.site/ (on version 13: https://typo3.13.test.it.ddev.site/ )

    Redirect module

    created a new redirect

    - Source Domain [source_host] : https://typo3.12.test.it.ddev.site (on version 13: https://typo3.13.test.it.ddev.site )
    - Source Path [source_path] : /testimage*
    - Target [target] : *t3://file?uid=72
    (on the modal window I selected the tab “FILES” and then an image)
    - Force SSL Redirect [force_https] : 1

    Result (TYPO3 12)

    when calling the URL https://typo3.12.test.it.ddev.site/testimage you are redirected to https://typo3.12.test.it.ddev.site/fileadmin/Images/test.jpg
    but the response-header is actually: https:/fileadmin/Images/test.jpg

    Result (TYPO3 13)

    when calling the URL https://typo3.13.test.it.ddev.site/testimage you are redirected to https://typo3.13.test.it.ddev.site/fileadmin/Images/test.jpg
    but the response-header is actually: https:/fileadmin/Images/test.jpg

    please note that I tested everything on Chrome, Desktop where everything somehow works nonetheless; I am not actually able to test it on a mobile device

  4. Thilo Ratnaweera commented <span data-processor="relativetime" data-value="2025-01-10T12:04:09+00:00" > 01/10/25, 12:04 </span>

    Thorsten May wrote:
    > When you create a redirect in the Redirects module that points to a file in fileadmin (t3://file?uid=xxx) and enable force_https, the resulting url looks like ‘https:/fileadmin/…‘
    >
    > Most browsers seem to handle this correctly and redirect to the chosen file, but iOS Browsers (Safari, Chrome) don’t add the domain an redirect to https://fileadmin/… what leads to an error.
    >
    > Maybe a problem in /sysext/core/Classes/Http/RedirectResponse.php with setting $headers[‘location’] = [(string)$uri] or in /sysext/redirects/Classes/Http/Middleware/RedirectHandler.php where buildRedirectResponse is called.

    I can confirm this and I consider this a bug.

    Even though some browsers are guessing correctly the response is incorrect and this should be fixed. I don’t feel entitled enough to change the issue properties, but I would recommend to change the “Priority” from “Should have” to “Must have”. Also, IMHO the subject could be more general as this is a problem with the HTTP response and has nothing to do with iOS per se.

    Regards

  5. Gerrit Code Review pushed patch set 1 for main to change 88376 status Needs Feedback Under Review <span data-processor="relativetime" data-value="2025-02-26T20:53:58+00:00" > 02/26/25, 20:53 </span>

  6. Georg Ringer commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2025-03-25T21:05:07+00:00" > 03/25/25, 21:05 </span>

    Applied in changeset commit:19ea923566b57e16c20d457d8ad4506c5910fc1a.