Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Host Locale Feature Not Applied to Static Routes #58086

Closed
@tugrul

Description

@tugrul

Symfony version(s) affected

6.4.10

Description

The host locale feature in Symfony is intended to set the locale based on the request's host. However, this feature does not work for static routes defined in routing configuration files. While the host locale is correctly applied when using annotation routes, static routes do not respect this configuration, resulting in the inability to serve localized static content like robots.txt based on the domain or subdomain.

How to reproduce

Expected config (it not works)

robots_txt:path:/robots.txthost:en:example.ukde:example.dedefaults:_controller:Symfony\Bundle\FrameworkBundle\Controller\TemplateController::templateAction_format:txttemplate:static/robots.txt.twig

Workaround (it works)

robots_txt.en:path:/robots.txthost:example.ukdefaults:_locale:en_controller:Symfony\Bundle\FrameworkBundle\Controller\TemplateController::templateAction_format:txt_canonical_route:robots_txttemplate:static/robots.txt.twigrobots_txt.de:path:/robots.txthost:example.dedefaults:_locale:de_controller:Symfony\Bundle\FrameworkBundle\Controller\TemplateController::templateAction_format:txt_canonical_route:robots_txttemplate:static/robots.txt.twig

Possible Solution

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp