ServerName无法工作Zend framework2



我在系统上安装了xampp和Zend框架2。当我运行代码时,发送帧工作良好。D:/examplep/htdocs/CommunicationApp/public显示效果良好

祝贺你!您已成功安装ZF2 Skeleton应用程序。您当前运行的是Zend Framework 2.3.4版本。这个框架可以作为一个简单的起点,让您开始在ZF2上构建应用程序。但当我在浏览器中运行服务器名称时,显示的是examplep localhost页面。请帮帮我我创建的服务器名称:

<VirtualHost *:80>
 ServerName comm-app.local
 DocumentRoot "D:/xampp/htdocs/CommunicationApp/public"
 SetEnv APPLICATION_ENV "development"
 <Directory D:/xampp/htdocs/CommunicationApp/public>
  DirectoryIndex index.php
 AllowOverride All
 Order allow,deny
 Allow from all
 </Directory>
</VirtualHost>

我找到我的answer.just重新排列我的.htaccess文件。

RewriteEngine On
# The following rule tells Apache that if the requested filename
# exists, simply serve it.
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
# The following rewrites all other queries to index.php. The 
# condition ensures that if you are using Apache aliases to do
# mass virtual hosting, the base path will be prepended to 
# allow proper resolution of the index.php file; it will work
# in non-aliased environments as well, providing a safe, one-size 
# fits all solution.
#RewriteCond %{REQUEST_URI}::$1 ^(/.+)(.+)::2$
#RewriteRule ^(.*) - [E=BASE:%1]
RewriteRule ^.*$ index.php [NC,L]

重新排列.htaccess文件后,重新启动我的apache。现在工作良好。

最新更新