【问题标题】:ZF2 application on Openshift: 404 not found when not '/'Openshift 上的 ZF2 应用程序: 404 not found when not '/'
【发布时间】:2015-11-22 02:51:10
【问题描述】:

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

主页正确显示,但是当我尝试登录时,我得到一个 404 not found。 URL 是/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>

并且在/public 中有一个.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]

【问题讨论】:

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


    【解决方案1】:

    问题出在我的http.conf 中,我将AllowOverride None 更改为AllowOverride All

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-06-27
      • 2021-12-27
      • 2016-05-05
      • 2011-01-24
      相关资源
      最近更新 更多