Openshift上的ZF2应用程序:未在' /'

时间:2015-08-27 15:53:10

标签: php .htaccess zend-framework2 http-status-code-404 openshift

我刚刚在Openshift here上部署了一个小型ZendFramework 2应用程序。

主页面已正确显示,但是当我尝试登录时,我找不到404。网址为/authenticate。事实上,任何非/网址都不起作用。

为什么?

更新

我的http.conf包含:

DocumentRoot ${OPENSHIFT_REPO_DIR}/public
<Directory "${OPENSHIFT_REPO_DIR}/public">
    Options +Indexes +FollowSymLinks +ExecCGI
    AddHandler cgi-script .cgi
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
DirectoryIndex index.php index.html index.cgi
AccessFileName .htaccess
<Files ~ "^\.ht">
    Order deny,allow
    Deny from all
</Files>

.htaccess中有一个/public

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]

1 个答案:

答案 0 :(得分:0)

问题发生在http.conf,我将AllowOverride None更改为AllowOverride All