开发者

Zend Route Hostname: Different depth of subdomains but same chains

开发者 https://www.devze.com 2023-04-12 09:53 出处:网络
I got 2 different hostnames. One for the live system and one for the developer one: m.example1.com and m.subdomain1.subdomain2.example2.com. I defined a routing (see below) for one of the them using c

I got 2 different hostnames. One for the live system and one for the developer one: m.example1.com and m.subdomain1.subdomain2.example2.com. I defined a routing (see below) for one of the them using chains. The webpage should deliver the same content for both URLs. example1.com and example2.com I can match with :domain.:tld but haven't found a way, to make the route match both URLs due the different depth of subdomains.

A solution would be to copy and paste the whole stuff including the chains, but this results in having to change both chains-definitions all the time. I fear that one forgets to change both and errors occur. Is there a way to match both without copy&paste the whole mobile route definition?

Definition for one hostname:

<mobile type="Zend_Controller_Router_Route_Hostname">
    <route>m.:sub1.:sub2.:domain.:tld</route>
    <chains>
        <index type="Zend_Controller_Router_Route">
            <route>search</route>
            <defaults>
                <controller>mobile</controller>
                <action>search</act开发者_如何学Goion>
            </defaults>
        </index>
        <menu type="Zend_Controller_Router_Route">
            <route>menu</route>
            <defaults>
                <controller>mobile</controller>
                <action>menu</action>
            </defaults>
        </menu>
    </chains>
</mobile>

Additional the chains should work with:

<route>m.:domain.:tld</route>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号