Cleankod
Cleankod

Reputation: 2340

.htaccess and Kohana's 2.x project in subdirectory

I have a website on Joomla 1.5 in my base dir - http://example.com - and another project written in Kohana 2.x - http://example.com/app.

The problem is that .htaccess in the subdirectory isn't working properly.

Question: How and which one .htaccess to configure? In subdirectory, my .htaccess file looks like this:

RewriteEngine On
RewriteBase /app/
RewriteRule ^(application|system) - [F,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]

The project in subdir always tries to go to the controller named "app" when I type "http://example.com/app".

Upvotes: 1

Views: 521

Answers (1)

Cleankod
Cleankod

Reputation: 2340

I have added the following:

RewriteRule ^(.*)$ index.php/$1 [PT,L]
RewriteRule ^$ index.php/$1 [PT,L]

And it is working perfectly!

The problem was with the hosting server. It did not handle the PT correctly and required to add above lines.

Everything worked fine:

However, the following did not work:

Seems like the index.php hasn't been added when nothing else were passed. Hence the line:

RewriteRule ^$ index.php/$1 [PT,L]

Upvotes: 1

Related Questions