routing posts

Symfony router: check for match on different host

I found myself wanting to check if a given URL path exists on another host of a multi-host Symfony application from within a controller action. The router service, which is the instance of Symfony’s routing component used to route requests to actions, has a match() method, but it only accepts the path part of the URL. It also has a matchRequest() method, but that seems to ignore the HTTP_HOST and SERVER_NAME of the passed Request object.

Continue reading post "Symfony router: check for match on different host"