我在 Web 根目录中运行了一个 Kohana 应用程序,一切正常。但是当我尝试使用非 kohana PHP 代码将子文件夹添加到根目录时,我无法访问它。Kohana仍然试图为文件找到一条路由。
例:
- public_html
- 应用
- 模块
- 子文件夹
- 索引.php
- 测试.html
如果我尝试访问/subfolder,则会收到以下错误:
类 controller_subfolder 不存在
但是如果我尝试访问/subfolder/test.html 它工作正常。
我的 .htaccess 文件是默认文件:
# Turn on URL rewriting RewriteEngine On # Installation directory RewriteBase / # Protect hidden files from being viewed <Files .*> Order Deny,Allow Deny From All </Files> # Protect application and system files from being viewed RewriteRule ^(?:application|modules|system)'b.* index.php/$0 [L] # Allow any files or directories that exist to be displayed directly RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # Rewrite all other URLs to index.php/URL RewriteRule .* index.php/$0 [PT]
也许 apache 没有配置为在 DirectoryIndex 中传递索引.php?
看看@http://httpd.apache.org/docs/2.0/mod/mod_dir.html