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