TheGodWings TheGodWings - 8 months ago 15
PHP Question

Social Engine 4 User profile rerouting

For Social Engine 4, which uses Zend framework.
I want to show user profiles under subdomains. so, will be

How can I do this. I do already have one extension which makes to Here is the code for it.

$route = array(
'user_profile' => array(
'route' => ':id/*',
'defaults' => array(
'module' => 'user',
'controller' => 'profile',
'action' => 'index'
'reqs' => array(
'id' => "\b.+"
Zend_Registry::get('Zend_Controller_Front')->getRouter()->addConfig(new Zend_Config($route));

Is it possible to change it to work for subdomains? If yes how can I do it?

Thank You in advance.

        $hostnameRoute = new Zend_Controller_Router_Route_Hostname(
                                                        'module' => 'user',
                                                        'controller' => 'profile',
                                                        'action' => 'index',
        $plainPathRoute = new Zend_Controller_Router_Route_Static('');
        $router->addRoute('user_profile', $hostnameRoute->chain($plainPathRoute));