Subdomains control for url in slim

There is not any built-in support for parsing subdomains. However, here’s how I would do this. I would configure the default Nginx virtual host to answer for these subdomains. The virtual host will direct all PHP requests to the appropriate Slim bootstrap file. You can write a simple Slim middleware that parses the request subdomain so you can take the necessary actions in your route callbacks. Does this make sense?

1 Like