Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 710
Thanks Avatar asked Jun 08 '09 19:06

Thanks


1 Answers

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'] = '';
like image 76
Ambirex Avatar answered Sep 20 '22 04:09

Ambirex