Platform.sh supports wildcard routes, so you can map multiple subdomains to the same application. Both redirect and upstream routes support wildcard routes. Prefix a route with an asterisk (*), for example *.{default}. If case of example.com as your default domain, HTTP requests to www.example.com, blog.example.com, and us.example.com are all routed to the same endpoint.
It also works on development environments. If you have a feature branch, it’s {default} domain looks something like: feature-def123-vmwklxcpbi6zq.us.platform.sh (depending on the project’s region). So requests to blog.feature-def123-vmwklxcpbi6zq.us.platform.sh and us.feature-def123-vmwklxcpbi6zq.eu.platform.sh are both routed to the same endpoint.
Note: Let’s Encrypt wildcard certificates aren’t supported (they would need DNS validation). So if you want to use a wildcard route and protect it with HTTPS, you need to provide a custom TLS certificate.
Comments
Please sign in to leave a comment.