1

I'm using Kohana 3.2 framework, I've put the standard .htaccess file in the same folder of the aplication.

my .htaccess file is

# Turn on URL rewriting
RewriteEngine On

# Installation directory
RewriteBase /mysite/

# 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've tried changing the las line to

RewriteRule ^(.*)$ /index.php/$0
RewriteRule ^(.*)$ /index.php/$0 [PT,L]
RewriteRule ^(.*)$ /index.php/$0 [PT,L,QSA]
RewriteRule .* /index.php/$0 [PT]  -  [PT,L]  -  [PT,L,QSA]

But it still shows

Not Found

The requested URL /index.php/login was not found on this server.

The complete path of the app is /var/www/es/ec/mysite

The complete working URL is http://10.0.0.1/ec/mysite/index.php/login

The complete NOT working URL is http://10.0.0.1/ec/mysite/login

Also...

Running in Apache 2.2.3 over CentOS 5

Any idea???

GusCh
  • 21
  • 1
  • 4

3 Answers3

1

I got it!!

Here is how it gets done when the app is inside other folders.

The complete path of the app is /var/www/es/ec/mysite

The complete working URL is http://10.0.0.1/ec/mysite/index.php/login

The complete NOT working URL was http://10.0.0.1/ec/mysite/login

In /var/www/es/ec/mysite/application/bootstrap.php the Kohana::init stays like this

Kohana::init(array(
    'base_url'   => '/ec/mysite/',
    'index_file'   => FALSE,
    'charset' => 'ISO-8859-1',
));

And the .htaccess like this

# 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 .* /ec/mysite/index.php/$0

Hope this helps some one else!

Cheers!

GusCh
  • 21
  • 1
  • 4
0

You can try my Kohana .htaccess file

# Set environment
SetEnv KOHANA_ENV "development"

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

I use Kohana 3.2, also. This rewrite tends to work for most of my projects.

Let me know how it works out!

TheBrent
  • 2,853
  • 3
  • 16
  • 14
  • Hi Brent Lingle, I try your .htaccess, but it still shows thw "Not Found - The requested URL /index.php was not found on this server." message. For the records I'm using Apache 2.2.3 on a Centos5 server. – GusCh Oct 29 '12 at 19:39
0

In your bootstrap.php inside Kohana::init set 'index_file' => '',

Meliborn
  • 6,495
  • 6
  • 34
  • 53
  • Thanks Meliborn, still getting the same message. Also tried with 'index_file' => 'index.php', and with the default param 'index_file' => FALSE. Any idea?? – GusCh Oct 29 '12 at 19:55
  • 'base_url' => dirname($_SERVER['SCRIPT_NAME']) – Meliborn Oct 29 '12 at 19:57