Issue Bug Closed

#106117baseVariant base on applicationContext Development not used for absolute URI

Holger Drosdek 02/07/25, 15:23 updated 02/10/25, 16:43

Description

When having base: / in config.yaml and an additional baseVariant base: ‘https://dev.example.com’ on condition: ‘applicationContext == “Development”’ no absolute URI can be build, e.g. by fluid Uri.action.
Only when main base has been edited with DEV-Domain like this

base: 'https://dev.example.com'
baseVariants:
  -
    base: 'https://dev.example.com'
    condition: 'applicationContext == "Development"'

the absolute URI is being build e.g. by fluid Uri.action.

Application Context setting has been established via .htaccess

    # Rules to set ApplicationContext based on hostname
    RewriteCond %{HTTP_HOST} ^dev\.example\.com/$
    RewriteRule .? - [E=TYPO3_CONTEXT:Development]
    RewriteCond %{HTTP_HOST} ^www\.example\.com$
    RewriteRule .? - [E=TYPO3_CONTEXT:Production]

This seems to be intended, as the description of entry point tells me
“Wenn es nur ein / ist, können Sie sich nicht darauf verlassen, dass TYPO3 die vollen URLs erzeugt.“
(If it’s just a /, you can’t rely on TYPO3 to generate the full URLs.)

This has been different in Typo3 11.5 and I’m wondering, for which purpose the baseVariants actualy are.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 11

  1. Chris Müller changed Duplicates #106116 02/07/25, 18:06

  2. Chris Müller changed status New Closed 02/07/25, 18:07

  3. Chris Müller changed status Closed New 02/07/25, 18:07

  4. Chris Müller commented and changed status New Closed 02/07/25, 18:08

    It should also be possible to edit your issue later. No need to create a new issue.

  5. Chris Müller changed status Closed New 02/07/25, 18:09

  6. Chris Müller changed Duplicates #106116 02/07/25, 18:10

  7. Chris Müller changed Duplicated by #106116 02/07/25, 18:11

  8. Garvin Hicking commented and changed status New Needs Feedback 02/07/25, 19:15

    Hm, I have this here working:

    base: /
    baseVariants:
      -
        base: 'https://demo.ddev.site'
        condition: 'applicationContext matches "#^Development/Ddev#"'
      -
        base: 'https://stage.example.com'
        condition: 'applicationContext == "Production/Staging"'
      -
        base: 'https://www.example.com'
        condition: 'applicationContext == "Production/Production"'

    Maybe your TypoScript config is what’s interferring? Do you have config.absRefPrefix = / set?

  9. Garvin Hicking commented 02/07/25, 19:17

    (Also, ensure your TYPO3_CONTEXT really gets propagated – check with adminpanel or xdebug or a PHP header at the end of the middleware or within the settings.php)

  10. Holger Drosdek commented 02/10/25, 12:04

    Thanks for hints, you are completely right. We did a server update at the same time, the environment variables for TYPO3_CONTEXT is missing actualy. Bug report can be closed, no Typo3 bug!

  11. Garvin Hicking commented and changed status Needs Feedback Closed 02/10/25, 16:43

    Great, thanks for getting back to it quickly.
    Closing as requested :-)