0
Hello folks this is my first post :D
I’m new to Zend framework and I’m using Zend 2 + PHP 5.5 + Mysql + Apache
I have the system on my server running through the address http://localhost and I am not using Apache Virtual Host, I am using only rewrite mode and file . htaccess
The problem:
- I want to put another NEW system on the same server where it could be accessed through localhost/system1 and localhost/system2 however every change I try to open the system, but when I try to access the menus it always tries to use the address localhost and not localhost/system1.
It’s like Zend has some place where I can configure what the project’s root directory is.
And even if I do not use the menus and directly type the url it tb does not work. I am using Zend Navigation for menus.
OBS.: I would not like to use Virtual Host, because when I go to host the system on a hosting usually they do not let you touch the settings of Apache.
Follow the . htaccess I’m putting inside localhost/system1 :
# Turn on rewrites.
RewriteEngine on
# Only apply to URLs on this domain
RewriteCond %{HTTP_HOST} ^(www.)?localhost$
# Only apply to URLs that aren't already under folder.
RewriteCond %{REQUEST_URI} !^/public/
# Don't apply to URLs that go to existing files or folders.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Rewrite all those to insert /folder.
RewriteRule ^(.*)$ public/$1
# Also redirect the root folder.
RewriteCond %{HTTP_HOST} ^(www.)?localhost$
RewriteRule ^(/)?$ public/index.php [L]
- I would like to make the two systems use the same Zend if possible, so that the Zend directory does not have to be redundant in ALL new systems. But that is not so important now. I have urgent to resolve the previous item.
Thank you guys and remember I’m new to Zend so give a little chewed explanation. (but in PHP I move for many years)