Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Make sure .htaccess tpl is applied if installed at document root
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Sep 17, 2014
1 parent b76fc96 commit bff5987
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions core/src/plugins/boot.conf/class.BootConfLoader.php
Expand Up @@ -205,14 +205,18 @@ public function applyInstallerForm($action, $httpVars, $fileVars)
if($data["ENCODING"] != (defined('AJXP_LOCALE')?AJXP_LOCALE:SystemTextEncoding::getEncoding())){
file_put_contents($this->getPluginWorkDir()."/encoding.php", "<?php \$ROOT_ENCODING='".$data["ENCODING"]."';");
}

$tpl = file_get_contents($this->getBaseDir()."/htaccess.tpl");
if(!empty($data["SERVER_URI"]) && $data["SERVER_URI"] != "/"){
$tpl = file_get_contents($this->getBaseDir()."/htaccess.tpl");
$htContent = str_replace('${APPLICATION_ROOT}', $data["SERVER_URI"], $tpl);
if(is_writeable(AJXP_INSTALL_PATH."/.htaccess")){
file_put_contents(AJXP_INSTALL_PATH."/.htaccess", $htContent);
}else{
$htAccessToUpdate = AJXP_INSTALL_PATH."/.htaccess";
}
}else{
$htContent = str_replace('${APPLICATION_ROOT}/', "/", $tpl);
$htContent = str_replace('${APPLICATION_ROOT}', "/", $htContent);
}
if(is_writeable(AJXP_INSTALL_PATH."/.htaccess")){
file_put_contents(AJXP_INSTALL_PATH."/.htaccess", $htContent);
}else{
$htAccessToUpdate = AJXP_INSTALL_PATH."/.htaccess";
}

if ($storageType == "db") {
Expand Down

0 comments on commit bff5987

Please sign in to comment.