Kohana3: Different .htaccess rewritebase and kohana base_url for dev and production environment
- by Svish
In my bootstrap.php I have the following:
if($_SERVER['SERVER_NAME'] == 'localhost')
Kohana::$environment = 'development';
else
Kohana::$environment = 'production';
...
switch(Kohana::$environment)
{
case 'development':
$settings = array('base_url' => '/kohana/', 'index_file' => FALSE);
break;
default:
$settings = array('base_url' => '/', 'index_file' => FALSE);
break;
}
In .htaccesshave this:
# Installation directory
RewriteBase /kohana/
This means that if I just upload my kohana application, it will break because the RewriteBase in the .htaccess file will be wrong. Is there a way I can have a conditional in the .htaccess file similar to the one I have in the bootstrap so that it will use the correct RewriteBase?