I've got a zend project situated within the /account sub folder. I wish to have the ability to create sub-domain virtual hosts and point their DocumentRoot for this sub folder

In index.php I've this line that sets the Link to the zend project folder

 define('SiteUrlUser','http://'.$_SERVER['HTTP_HOST'].'/account/');

The DocumentRoot setup for just one sub-domain is

 DocumentRoot /var/www/account

As i am browsing the website at subomdain.domain.com it always adds /account towards the Web addresses that is normal however throws this error

Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller specified (account)'

If I remove /account from the URL while being able to access the website via a subdomain the web pages render all right. So essentially www.domain.com/account/something.html inside a subdomain could be subdomain.domain.com/something.html that is working perfectly fine.

I am likely to setup the server to ensure that all customers will login through their sub-domain. The zend folder is going to be put by itself server and used because the DocumentRoot for those sub-domain names what exactly would I alternation in the index.php to make this happen?

Thanks

I wouldnt nest the project inside another non-zend project, i'd provide its very own root out side the net accessible dir from the other project and point the subdomain there. Then simply make your module/controller for account the default via routing.

However should you choose nest them then you'll have to set the [cde]

When the parent project is another zend application i quickly would merge the 2 together and employ routing to handle sub-dir mapping by doing this you are able to perform a wildcard vhost and point all of them towards the same application instance around the filesystem.