#106490it should be possible to define static routes differently depending on application context
Description
In a site configuration it should be possible to define static routes differently depending on the application context. While it is possible to define different base variants, it should likewise be possible to define different static routes. The following example shall illustrate the benefits.
base: /
baseVariants:
-
base: 'https://example.com'
condition: 'applicationContext == "Production"'
-
base: 'https://staging.example.com'
condition: 'applicationContext == "Staging"'
-
base: 'http://localhost:8000'
condition: 'applicationContext == "Development"'
[...]
routes:
-
route: robots.txt
condition: 'applicationContext == "Production"'
type: staticText
content: "User-agent: *\r\nDisallow: /typo3/\r\nDisallow: /typo3_src/\r\nAllow: /typo3/sysext/frontend/Resources/Public/*\r\nSitemap: path/to/sitemap.xml"
-
route: robots.txt
condition: 'applicationContext == "Staging"'
type: staticText
content: "User-agent: *\r\nDisallow: /"
websiteTitle: My Website
I hope I did not overlook any duplicate issues and/or any explanations in the docs as to why this is designed the way it is. Also, I would love to know how others use this feature and how they deal with different requirements in different contexts (especially for robots.txt).
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Fix this issue
Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". How to create a patch
- Commit message
-
[FEATURE] it should be possible to define static routes differently depending on application context Resolves: #106490 Releases: main