A module of my project should have it's own domain so i created a route for it:
$portalurl = str_replace( 'http://', '', $config->domains->portal );
$hostnameRoute = new Zend_Controller_Router_Route_Hostname(
$portalurl,
array( 'module' => 'portal' )
);
$defaultroute = new Zend_Controller_Router_Route(
':controller/:action',
array(
'controller' => 'index',
'action' => 'index'
)
);
$contentroute = new Zend_Controller_Router_Route(
'page/:page',
array(
'controller'=> 'content',
'action' => 'show'
)
);
$router->addRoute( 'portalDefault', $hostnameRoute->chain($defaultroute) );
$router->addRoute( 'portalContent', $hostnameRoute->chain($contentroute) );
In my test system my application is in a sub directory like /project/public which works fine when i open the module via the domain i entered in my system host list. domain.lan/project/public. Now i want to assemble a url via the system (redirect) and it assebles it without the sub directory.
$this->_redirect(
$this->view->url(array(
'action' => 'index',
'controller' => 'index')
),
array( 'prependBase' => false )
);
Yes i know the easiest way to solve it, is to configure a vhost but it bothers me that i can't find another solution wich allows it to function without a vhost and setting the path manually in the routes.
What is the best approach for this?