Install zend framework without apache virtual hosts

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

Basically, I want, when I go to http: // localhost / invent , to work as if I had a virtual host "invent" defined in the apache conf file (for example, access to http: // invent ). How can i achieve this? I developed my project under windows, installing virtual hosts, but I do not want to continue working like that because I cannot deploy my application to public web hosting services that do not allow creating virtual hosts. Not to mention the fact that if I deploy the application on the local network, I also need to configure the client host file ... Please help, this is the most unpleasant thing with zend (have not tried other frameworks yet).

+3
source share
2 answers

The root of your application document is where you place the index.php file, the location of the Zend Framework library and the application code do not matter.

If you used the BaseUrl helper helper in your views for static assets (JavaScript, CSS, images) and the Url helper to reference actions, your application should be very portable regarding the relative path from the root of the web server document.

Let me know if I am leaving here. Your question may concern more details.

+4
source

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

+1
source

Source: https://habr.com/ru/post/1339641/


All Articles