Support routes to only be relative to the domain without site paths #17155
MoritzLost
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
By default, all routes will apply to all sites, so I can prefix a route with any site URL. The route will also apply to the domain without any path prefix from any of the sites. Take this route:
And let's say I have two sites, German and English, using
example.com/de
andexample.com/en
as their base URL, respectively. German is the primary site. Now all of the following URLs will load my sitemap route:Now, I can limit that to one or both of the specified sites by using site-specific routes. But what I really want is to only create a route for
example.com/sitemap.xml
and not for the language prefixes.This is not possible at the moment as far as I can tell, as the routes are always considered relative to the current site's base URL, and the primary site will be loaded as a fallback. Also, because of this, even if I limit my route to the primary site (German), the route will still be available under both of the following URLs:
What I would like to see is the option to only create one of those at a time. In this case, I want the route to only apply to the root domain without the site's path prefix. Conversely, sometimes I want to also create a route that only exists under the site's path prefix and not under the root domain, which is not possible for the primary site.
Not sure what form those options could take in the
routes.php
, though.Beta Was this translation helpful? Give feedback.
All reactions