0

I want to match a route only when there is no subdomain in the url:

Here is the route where I match the subdomain being "api"

/**
 * @Route("/properties/save", host="api.{host}", name="api_property_save",requirements={"host"=".*"},methods={"PUT"})
 */
public function saveApi()
{
...

Here I would like to match only if there is no subdomain specified.

/**
 * @Route("/properties/save", name="property_save")
 */
public function save()
{
...
Vlad Dogarescu
  • 153
  • 1
  • 11
  • Here is some examples https://symfony.com/doc/current/routing/hostname_pattern.html#using-placeholders – mcek Dec 11 '18 at 14:00
  • thanks, I looked into the symfony docs, but there is no example for when i target specifically the "no subdomain" case. – Vlad Dogarescu Dec 11 '18 at 15:29
  • Defined host doesn't work? `* @Route("/properties/save", host="{host}", name="property_save")` – mcek Dec 12 '18 at 06:23

0 Answers0