Nel mio bootstrap.php
ho il seguente:Kohana3: Different RewriteBase .htaccess e kohana base_url per l'ambiente dev e la produzione
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 .htaccess
hanno questo:
# Installation directory
RewriteBase /kohana/
Questo significa che se ho appena carica la mia applicazione kohana, si romperà perché il RewriteBase nel file .htaccess
avrà torto. C'è un modo per avere un condizionale nel file .htaccess
simile a quello che ho nel bootstrap in modo che utilizzi il corretto RewriteBase?
Clever quello ultimo lì ... Devo impostare AccessFileName in httpd.conf? Posso impostarli anche per host virtuale? – Svish
@Svish in base al manuale, sì. –
AccessFileName supporta effettivamente più di un nome di file, quindi potrei semplicemente aggiungere quanto segue: 'AccessFileName local.htaccess .htaccess' ei normali file .htaccess funzionerebbero comunque :) – Svish