0

我已经安装了 Zend Framework 并使其运行(apache 服务器),但我遇到了以下问题。每当我尝试访问时,http://localhost/public/index.php我都会收到 404 错误。但是当我尝试的时候http://localhost/public/还是http://localhost/public/index.php/正常的zf2骨架应用程序显示没有任何问题。你能帮我如何让它不在 index.php 上显示 404 吗?这个文件肯定存在。

这是 .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 ^(.*)$ %{ENV:BASE}index.php [NC,L]

DirectoryIndex index.php
4

0 回答 0