nikic / FastRoute

Fast request router for PHP
Other
5.13k stars 445 forks source link

multiple domain support #195

Closed 137-rick closed 2 years ago

137-rick commented 5 years ago

now i was 'new' three fastRouter object for three domain how about consider to make this support multiple domain for one dispatcher?

Cryental commented 5 years ago

I think it's a good idea too. Sometimes we need to use one script for multiple domains such as custom domain service. So I agree for this.

ghost commented 5 years ago

I think it's a very good idea, several other routers have already integrated a domain and subdomain management concept.

SignpostMarv commented 4 years ago

I handle this one by just not compiling the hostname into the route. https://github.com/daft-framework/daft-router/blob/e96ba423cfa5ea49c7369e43653633c9a14ad81b/src/Router/Dispatcher.php#L58

SergkeiM commented 4 years ago

Also waiting for this to use in Lumen

kktsvetkov commented 2 years ago

I assume this is about having parameters inside the hostname, like "{user}.mydomain.xyz" -- right? Because if you only need separate route collections for different hostnames, you can just use separate route collections.

Using the hostname as a prefix does not seem like a good idea as it will create a bigger route collection and that will negatively impact the routing performance.

lcobucci commented 2 years ago

I really don't think it's wise to have a big collection for different domains. As highlighted by @kktsvetkov it will have an impact on performance.