<p dir="auto">Trying to use hostname_pattern as per <a href="http://symfony.com/doc/master/components/routing/hostname_pattern.html" rel="nofollow">http://symfony.com/doc/master/components/routing/hostname_pattern.html</a></p>
<p dir="auto">like this:<br>
routing.yml</p>
<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="#Bike
bike:
    prefix: /
    pattern: /
    hostname_pattern: *.cykelverkstad.nu
    defaults: { _controller: EmpireBikeBundle:Homepage:index }"><pre class="notranslate"><span class="pl-c"><span class="pl-c">#</span>Bike</span>
<span class="pl-ent">bike</span>:
    <span class="pl-ent">prefix</span>: <span class="pl-s">/</span>
    <span class="pl-ent">pattern</span>: <span class="pl-s">/</span>
    <span class="pl-ent">hostname_pattern</span>: <span class="pl-s">*.cykelverkstad.nu</span>
    <span class="pl-ent">defaults</span>: <span class="pl-s">{ _controller: EmpireBikeBundle:Homepage:index }</span></pre></div>
<p dir="auto">using this composer.json require:</p>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
    &quot;require&quot;: {
        &quot;php&quot;: &quot;&gt;=5.3.3&quot;,
        &quot;symfony/symfony&quot;: &quot;2.2.*&quot;,
        &quot;doctrine/orm&quot;: &quot;&gt;=2.2.3,&lt;2.4-dev&quot;,
        &quot;doctrine/doctrine-bundle&quot;: &quot;1.2.*&quot;,
        &quot;twig/extensions&quot;: &quot;1.0.*&quot;,
        &quot;symfony/assetic-bundle&quot;: &quot;2.2.*&quot;,
        &quot;symfony/swiftmailer-bundle&quot;: &quot;2.2.*&quot;,
        &quot;symfony/monolog-bundle&quot;: &quot;2.2.*&quot;,
        &quot;sensio/distribution-bundle&quot;: &quot;2.2.*&quot;,
        &quot;sensio/framework-extra-bundle&quot;: &quot;2.2.*&quot;,
        &quot;sensio/generator-bundle&quot;: &quot;2.2.*&quot;,
        &quot;jms/security-extra-bundle&quot;: &quot;1.4.*&quot;,
        &quot;jms/di-extra-bundle&quot;: &quot;1.3.*&quot;,
        &quot;jms/serializer-bundle&quot;: &quot;0.9&quot;,
        &quot;friendsofsymfony/rest-bundle&quot;: &quot;0.10.0&quot;
    },
}"><pre class="notranslate">{
    <span class="pl-ent">"require"</span>: {
        <span class="pl-ent">"php"</span>: <span class="pl-s"><span class="pl-pds">"</span>&gt;=5.3.3<span class="pl-pds">"</span></span>,
        <span class="pl-ent">"symfony/symfony"</span>: <span class="pl-s"><span class="pl-pds">"</span>2.2.*<span class="pl-pds">"</span></span>,
        <span class="pl-ent">"doctrine/orm"</span>: <span class="pl-s"><span class="pl-pds">"</span>&gt;=2.2.3,&lt;2.4-dev<span class="pl-pds">"</span></span>,
        <span class="pl-ent">"doctrine/doctrine-bundle"</span>: <span class="pl-s"><span class="pl-pds">"</span>1.2.*<span class="pl-pds">"</span></span>,
        <span class="pl-ent">"twig/extensions"</span>: <span class="pl-s"><span class="pl-pds">"</span>1.0.*<span class="pl-pds">"</span></span>,
        <span class="pl-ent">"symfony/assetic-bundle"</span>: <span class="pl-s"><span class="pl-pds">"</span>2.2.*<span class="pl-pds">"</span></span>,
        <span class="pl-ent">"symfony/swiftmailer-bundle"</span>: <span class="pl-s"><span class="pl-pds">"</span>2.2.*<span class="pl-pds">"</span></span>,
        <span class="pl-ent">"symfony/monolog-bundle"</span>: <span class="pl-s"><span class="pl-pds">"</span>2.2.*<span class="pl-pds">"</span></span>,
        <span class="pl-ent">"sensio/distribution-bundle"</span>: <span class="pl-s"><span class="pl-pds">"</span>2.2.*<span class="pl-pds">"</span></span>,
        <span class="pl-ent">"sensio/framework-extra-bundle"</span>: <span class="pl-s"><span class="pl-pds">"</span>2.2.*<span class="pl-pds">"</span></span>,
        <span class="pl-ent">"sensio/generator-bundle"</span>: <span class="pl-s"><span class="pl-pds">"</span>2.2.*<span class="pl-pds">"</span></span>,
        <span class="pl-ent">"jms/security-extra-bundle"</span>: <span class="pl-s"><span class="pl-pds">"</span>1.4.*<span class="pl-pds">"</span></span>,
        <span class="pl-ent">"jms/di-extra-bundle"</span>: <span class="pl-s"><span class="pl-pds">"</span>1.3.*<span class="pl-pds">"</span></span>,
        <span class="pl-ent">"jms/serializer-bundle"</span>: <span class="pl-s"><span class="pl-pds">"</span>0.9<span class="pl-pds">"</span></span>,
        <span class="pl-ent">"friendsofsymfony/rest-bundle"</span>: <span class="pl-s"><span class="pl-pds">"</span>0.10.0<span class="pl-pds">"</span></span>
    },
}</pre></div>
<p dir="auto">Debug-bar shows symfony as 2.2.</p>
<p dir="auto">Getting this error:<br>
[InvalidArgumentException]<br>
The routing file "D:/Dev/wamp/www/empire/app/config\routing.yml" contains u<br>
nsupported keys for "bike": "hostname_pattern". Expected one of: "resource"<br>
, "type", "prefix", "pattern", "path", "hostname", "schemes", "methods", "d<br>
efaults", "requirements", "options".</p>
<p dir="auto">It says "hostname_pattern" is a unsupported key, even though Symfony is on 2.2.</p>
<p dir="auto">Currently running into an issue with the new host matching when I'm trying to generate urls that requires me to pass in a host parameter.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="InternalUserController:
    resource: &quot;@ApiBundle/Controller/Internal/UserController.php&quot;
    type: annotation
    host: &quot;api.{domain}&quot;

DashboardController:
    resource: &quot;@DashboardBundle/Controller/DashboardController.php&quot;
    type: annotation
    host: &quot;{domain}&quot;"><pre lang="ymal" class="notranslate"><code class="notranslate">InternalUserController:
    resource: "@ApiBundle/Controller/Internal/UserController.php"
    type: annotation
    host: "api.{domain}"

DashboardController:
    resource: "@DashboardBundle/Controller/DashboardController.php"
    type: annotation
    host: "{domain}"
</code></pre></div>
<p dir="auto">The examples above work perfectly with the url matcher, but when needing to generate the url, it will require me to provide the domain parameter each time. I know this is how it's suppose to function, but it seems a bit annoying to require putting in the domain each time.</p>