How to set up .htaccess for Kohana correctly, so that there is no ugly "index.php/" in the URL?

Thanks picture Thanks · Jun 8, 2009 · Viewed 21.6k times · Source

After 2 hours now I couldn't get it right.

The Kohana installation is accessible directly under my domain, i.e. "http://something.org/"

Instead of http://something.org/index.php/welcomde/index I want to have URLs like http://something.org/welcome/index

My .htaccess is messed up completely. It's actually the standard example.htaccess that came with the download. It's almost useless. On the kohana page is a tutorial "how to remove the index.php". It's really useless as well, since it will not even talk about how to remove it. Totally confusing.

Please, can someone provide his working .htaccess for a standard kohana installation?

Answer

Ambirex picture Ambirex · Jun 9, 2009

My htaccess looks like the example.

RewriteEngine On

RewriteBase /

RewriteRule ^(application|modules|system) - [F,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule .* index.php/$0 [PT,L]

But you also have to change the config.php file to:

$config['index_page'] = '';