访问index.php时遇到404错误 - zend framework 2

时间:2013-07-18 13:01:06

标签: php apache frameworks zend-framework2 http-status-code-404

我已经安装了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

0 个答案:

没有答案