我使用 Kohana v = 3.2 并想访问位于webroot上的check.php
webroot
modules
application
system
index.php
check.php
.htaccess
但是当我访问domain.com/check.php时,我找到了
HTTP_Exception_404 [404]:无法找到匹配URI的路由: check.php
任何人都可以提供帮助,以便我可以访问 domain.com/check.php 这个文件吗?
答案 0 :(得分:0)
以下是Kohana附带的默认.htaccess文件(example.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]
要启用check.php
文件,请确保.htaccess文件底部包含以下行:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* index.php/$0 [PT]