访问非Kohana php文件

时间:2012-05-10 16:26:48

标签: php .htaccess kohana

我在Web根目录中运行了一个Kohana应用程序,一切正常。但是当我尝试使用非kohana PHP代码将子文件夹添加到根目录时,我无法访问它。 Kohana仍然试图找到文件的路线..

示例:

  • 的public_html
    • 应用
    • 模块
    • 子文件夹
      • 的index.php
      • 的test.html

如果我尝试访问/子文件夹,则会收到以下错误:

类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]

1 个答案:

答案 0 :(得分:1)

也许apache没有配置为在DirectoryIndex中传递index.php?

看看@ http://httpd.apache.org/docs/2.0/mod/mod_dir.html