Welcome Guest, Not a member yet? Register   Sign In
Wildcard Subdomains and Host name
#1

I am trying to setup routing based on hostname and subdomains.
in my routes, I have something similar to
PHP Code:
$routes->post('/''Api:endpoint', ['hostname' => 'my.apiserver.com']);

$routes->post('/''TeamApi:endpoint', ['subdomain' => '*']); 

In my config my baseurl is 'my.apiserver.com'

The goal is for post requests to the 'my.apiserver.com' host to go to Api:endpoint and for requests to 'team.my.apiserver.com' to go to TeamApi:endpoint.

The effect is that Api:endpoint is never reached, and all directed towards the TeamApi:endpoint.  Because the subdomain is dynamic and is assigned to a group, it cannot be hard coded.  Is there a way to achieve the goal in routing or is a different approach necessary?
Reply


Messages In This Thread
Wildcard Subdomains and Host name - by rockinmusicgv - 08-07-2022, 04:29 PM



Theme © iAndrew 2016 - Forum software by © MyBB