Add templates for the main .htaccess so the RewriteBase can adapted

if the main /limesurvey alias is disabled
This commit is contained in:
Daniel Berteaud 2014-08-13 11:32:41 +02:00
parent 85cc0e73ef
commit 46f288ba57
2 changed files with 15 additions and 0 deletions

View File

@ -5,6 +5,7 @@ use esmith::Build::CreateLinks qw(:all);
# Templates to expand
templates2events("/etc/e-smith/sql/init/limesurvey", qw(bootstrap-console-save webapps-update));
templates2events("/usr/share/limesurvey/application/config/config.php", qw(bootstrap-console-save webapps-update));
templates2events("/usr/share/limesurvey/.htaccess", qw(bootstrap-console-save webapps-update));
safe_symlink("/etc/e-smith/templates-default/template-begin-php", "root/etc/e-smith/templates/usr/share/limesurvey/application/config/config.php/template-begin");
safe_symlink("/etc/e-smith/templates-default/template-end-php", "root/etc/e-smith/templates/usr/share/limesurvey/application/config/config.php/template-end");

View File

@ -0,0 +1,14 @@
<IfModule mod_rewrite.c>
RewriteEngine on
{
my $alias = $limesurvey{'AliasOnPrimary'} || 'enabled';
if ($alias ne 'disabled'){
$OUT .= " RewriteBase /limesurvey\n";
}
else{
$OUT .= '';
}
}
RewriteCond %\{REQUEST_FILENAME\} !-f
RewriteRule . index.php
</IfModule>