2008年12月8日星期一

[fw-core] Hostname routing query

Hi,

Currently I have a route for static pages (e.g. about, terms, privacy, ...) like...

'static_path' => array(
        'type'  => 'Zend_Controller_Router_Route_Regex',
        'route' => 'pages(\/.+)?',
        'defaults' => array(
            'controller'      => 'static',
            'action'          => 'view'
        ),
        'map' => array(
            1                 => 'file'
        ),
        'reverse'              => 'pages/%s'
    ),

Which handles routes like...
domain.com/pages/about
domain.com/pages/help/someting
etc.

How can I use the hostname routing to achieve...
pages.domain.com/about
pages.domain.com/help/something

All help is appreciated.
-R

P.S. I tried to achieve it by reading the documentation but came up with no working solution :)

没有评论: