【发布时间】: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