3
votes

I have my website in /var/www/invent. I have zend-framework in /var/www/invent/library.

Basically what i want is when i access http://localhost/invent to work as if i had a virtual host "invent" defined in apache conf file (like accessing http://invent). How can I achieve this? I have developed my project under windows, having virtual hosts set up but I don't want to continue working like this because i cannot deploy my app on public webhosting services that do not allow me to create virtual hosts. Not to mention that if I deploy an app on a LAN, i need to configure the client's hosts file as well... Please help, this is the most annoying thing with zend (haven't tried other frameworks so far though).

2
I'm having trouble understanding your question. Could you describe the actual problems you're running into? - Phil
well i want to have a way to deploy my zend app without needing to add a vhost in the webserver's config file (and /etc/hosts file). I know i have to use .htaccess but i can't figure out how. - user253530
and since my Zend and ZendX folders are in the library folder of the app i want to take, let's say, my working application folder (say c:/wamp/www/invent) and put it on my linux box (say /var/www/invent) and to behave as on windows (on my windows box i have defined vhosts and changed the etc/hosts file so to access my application by typing invent). What I want is a general solution for placing the zend app folder on another webserver and just work without special configs (which sometimes cannot be made on free webhosting services). - user253530

2 Answers

4
votes

Your application document root is wherever you place your index.php file, the locations of the Zend Framework library and your application code are irrelevant.

Provided you've used the BaseUrl helper in your views for static assets (JavaScript, CSS, images) and the Url helper for action links, your application should be very portable in regards to relative path from the web server document root.

Let me know if I'm way off track here. Your question could do with some more details.

1
votes

remove vhost property and go directly to http://localhost/yourproject/public folder. You will need to stay with htaccess mod_rewrite , don't delete mod_rewrite properties in htaccess