【发布时间】:2010-01-16 18:14:16
【问题描述】:
我有一个如下所示的.htaccess 文件:
SetEnv APPLICATION_ENV development
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
如果我浏览到我正在测试的网站,比如http://www.example.com/,则索引页面会正确加载。
这是一个 Zend Framework 应用程序,因此它应该将事情路由到我的控制器,如果我转到 http://www.example.com/index/index 或 http://www.example.com/index 时它会正确执行,分别指定控制器 + 操作和仅控制器。
如果我执行http://www.example.com/index/test 之类的操作,它也可以工作,我在索引控制器上定义了另一个名为 test 的操作。
但如果我创建一个TestController.php 文件,并尝试转到http://example.com/test/,Apache 将返回:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /path/to/website/root/public/index.php was not found on this server.</p>
<hr>
<address>Apache/2.2.8 (Ubuntu) DAV/2 SVN/1.4.6 PHP/5.2.4-2ubuntu5.10 with Suhosin-Patch Phusion_Passenger/2.0.3 mod_perl/2.0.3 Perl/v5.8.8 Server at www.example.com Port 80</address>
</body></html>
谁能看到我在这里搞砸了什么?
比利3
编辑:我网站的配置类似于:
Alias /MySiteRoot/ "/usr/local/vsites/something/www/"
<Directory /usr/local/vsites/something/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
【问题讨论】:
标签: php zend-framework