我正在建立一个 Zend 网站。项目(本地)具有以下结构:
/app
/controllers
/views
/public
/css
/images
/js
.htaccess
index.php
因为 .htaccess 和 index.php 文件位于公共目录中,所以公共目录必须被 apache 识别为网站的文档根目录和根目录。
所以我应该去编辑 httpd.conf 文件中的“DocumentRoot from c:/wamp/www/ to c:/wamp/www/my-zend-app/public”。但是,如果我这样做,我将无法访问“c:/wamp/www/”中的其他项目。我可以保留两个 documentRoots 吗?
编辑 我尝试取消注释关于“httpd-vhost.conf”的 httpd.conf 行并编辑文件:
[httpd-vhost.conf]
<VirtualHost *:80>
ServerAdmin webmaster@dum.com
DocumentRoot "C:\wamp\www\my-zend-app\application\public"
ServerName website.loc
ErrorLog "C:\wamp\www\my-zend-app\application\public\error.log"
CustomLog "C:\wamp\www\my-zend-app\application\access.log" common
</VirtualHost>
在编辑 Windows 主机文件后添加:
127.0.0.1 website.loc
但它不起作用。我正在运行 WAMPSERVER 2.1