2
我正在使用PHP 5.4,Zend Studio和Zend-Server。当URI正确时获取404错误
我得到一个404错误,当我使用这个URI:
http://localhost/MyExample/public/index.php
但是当我使用这个URI我得到正确的页面显示:
http://localhost/MyExample/public/index.php/
,我觉得这两个乌里会是一样的。
下面是.htaccess文件:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteCond %{REQUEST_URI}::$1 ^(/.+)(.+)::\2$
RewriteRule ^(.*)$ - [E=BASE:%1]
RewriteRule ^(.*)$ %{ENV:BASE}index.php [NC,L]
这里是index.php的代码:
<?php
/**
* This makes our life easier when dealing with paths. Everything is relative
* to the application root now.
*/
chdir(dirname(__DIR__));
// Setup autoloading
require 'init_autoloader.php';
// Run the application!
Zend\Mvc\Application::init(require 'config/application.config.php')->run();
与.htaccess有关吗? – Class 2013-02-24 04:45:02
它可能是。我只是不确定是什么。 – 2013-02-24 04:45:58
你能发布相关的代码,你有.htaccess或任何其他相关的网址如:php代码 – Class 2013-02-24 04:48:02