Permalink
Browse files

Merge pull request #67 from lowki/master

Added RewriteBase in htaccess
  • Loading branch information...
wakdev committed May 17, 2013
2 parents 33c0a22 + ae66ae8 commit bd1ff0b6ab51cc5fb0ceddcadf0993b1644dd466
Showing with 7 additions and 0 deletions.
  1. +1 −0 .htaccess
  2. +6 −0 setup/SlSetup.php
@@ -25,4 +25,5 @@ RewriteRule article-([0-9]+).* index.php?mod=sl_articles&id=$1 [L]
#php_value error_reporting 30719

#Rewrite responsive images only to show_image script
RewriteBase /
RewriteRule (medias/(?:images|attachments)/.*\.(?:jpe?g|gif|png|JPE?G|GIF|PNG))(?:/(\d*\w*))?(?:/(\d*\w*))? core/common/class/functions/includes/show_image.php?url=$1&width=$2&height=$3
@@ -226,6 +226,7 @@ private function install(){
if(!$fatals){
// Create config file
if(!copy($source,$dest)) $fatals[] = "Erreur lors de la création du fichier de configuration";
$config = file_get_contents($dest);
$config = str_replace("_bdd_host",$_SESSION['bdd_host'],$config);
@@ -243,6 +244,11 @@ private function install(){
$config = str_replace("_site_name",$_SESSION['site_name'],$config);
$config = str_replace("_site_url",$_SESSION['site_url']."/",$config);
file_put_contents($dest, $config);
// Replace RewriteBase line in htaccess
$htaccess = file_get_contents("../.htaccess");
$htaccess = str_replace("RewriteBase /", "RewriteBase ".$_SESSION['site_path'], $htaccess);
file_put_contents("../.htaccess", $htaccess);
}
$this->view->loadInstall($fatals);

0 comments on commit bd1ff0b

Please sign in to comment.