Kohana 3.3路由问题 - .htaccess?

时间:2022-10-13 15:38:04

I have the following bootstrap.php routing (its the default):

我有以下bootstrap.php路由(默认值):

Route::set('default', '(<controller>(/<action>(/<id>)))')
    ->defaults(array(
        'controller' => 'Index',
        'action'     => 'index',
    ));

I have the following file structure:

我有以下文件结构:

application/
  classes/
    Constroller/
      Auth.php

I have the following .htaccess file:

我有以下.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]

I am on an opensuse 11 Amazon EC2 instance and when I go to mydomain.com/auth or mydomain.com/Auth I am getting a generic 404 message from Apache. Is there something wrong in my htaccess possibly?

我正在使用opensuse 11 Amazon EC2实例,当我访问mydomain.com/auth或mydomain.com/Auth时,我收到来自Apache的通用404消息。我的htaccess可能有问题吗?

1 个解决方案

#1


2  

Make sure the htaccess file is readable by apache (e.g. 644 or some similar mode) and that the AllowOverride setting in the server/vhost config is set to something appropriate (All or FileInfo).

确保apache(例如644或某些类似模式)可以读取htaccess文件,并确保server / vhost配置中的AllowOverride设置为适当的值(All或FileInfo)。

#1


2  

Make sure the htaccess file is readable by apache (e.g. 644 or some similar mode) and that the AllowOverride setting in the server/vhost config is set to something appropriate (All or FileInfo).

确保apache(例如644或某些类似模式)可以读取htaccess文件,并确保server / vhost配置中的AllowOverride设置为适当的值(All或FileInfo)。