ServerName 不工作 Zend framework2

ServerName not working Zend framework2

我已经在我的系统上安装了 xampp 和 Zend framework 2。当我 运行 代码发送框架工作正常时。 D: /xampp/htdocs/CommunicationApp/public 效果很好

恭喜!您已成功安装 ZF2 骨架应用程序。您当前 运行ning Zend Framework 版本 2.3.4。这个框架可以作为一个简单的起点,让您开始在 ZF2 上构建您的应用程序。 但是当我 运行 浏览器中的服务器名称显示 xampp 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}:: ^(/.+)(.+)::$
#RewriteRule ^(.*) - [E=BASE:%1]
RewriteRule ^.*$ index.php [NC,L]

重新排列 .htaccess 文件并重新启动我的 apache.Now 工作正常。