Reputation:
I used a small tutorial to create a menu through the Navigation_Menu view helper. I created my Zend folder inside a subfolder of localhost so now I can access this in my brwoser with
localhost/project/public
Now the menu gets a relative url from my config. For instance 'about' maps to /index/about
. Now my view helper maps 'about' to localhost/index/about
. How can I map this to localhost/project/public/index/about
without altering my config file?
Most probably, this is not Zend specific, so correct me if I'm wrong.
Upvotes: 2
Views: 133
Reputation: 16455
Assuming you are using Xampp/Apache lokal Webserver, here's the HowTo on setting up a local Domain
$xamppRoot / apache / conf / extra
Folderhttp-vhosts.conf
Now comes the variable part and i will just post my Structure. You may edit Servername
(which basically is the url/domain), DocumentRoot
(which is the path to project/public), SetEnv APPLICATION_ENV $yourenv
(Zend Config Environment) and <Directory ...>
(which once again is the path to project/public)
<Virtualhost *:80>
ServerName hod.dev
DocumentRoot "C:\xampp\htdocs\prvt\cahod\public"
SetEnv APPLICATION_ENV "local"
<Directory C:\xampp\htdocs\prvt\cahod\public>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
With this your Apache now knows how to Set up a local domain. The only thing left to do now is to make your local machine not access the internet when accessing http://hod.dev
HOSTS
(you may use a simple text editor)127.0.0.1 hod.dev
PS: I'm sorry that the code-block above does look shitty, but somehow it doesn't work really well in here - breaks the code somehow :(
Upvotes: 1
Reputation: 2673
Maybe you need to set or change the baseUrl
parameter in your configuration file. Something like the following:
resources.frontController.baseUrl = "/project/public"
Hope that helps,
Upvotes: 0