diff --git a/e107.htaccess b/e107.htaccess index 0174b7344..9ed7256db 100644 --- a/e107.htaccess +++ b/e107.htaccess @@ -38,6 +38,9 @@ ### LimitRequestBody 10240000 + +SetEnv HTTP_MOD_REWRITE On + ### enable rewrites Options +FollowSymLinks RewriteEngine On diff --git a/e107_admin/eurl.php b/e107_admin/eurl.php index 17613ed6f..a3723d1e3 100644 --- a/e107_admin/eurl.php +++ b/e107_admin/eurl.php @@ -63,6 +63,14 @@ class eurl_admin_ui extends e_admin_controller_ui public function init() { + + + $htaccess = file_get_contents(e_BASE.".htaccess"); + + if(strpos($htaccess, 'SetEnv HTTP_MOD_REWRITE On')===false) + { + e107::getMessage()->addWarning("Mod-rewrite is disabled. Please add the following to your .htaccess file after the line \"Rewrite Engine On\":
SetEnv HTTP_MOD_REWRITE On
"); + } if(is_array($_POST['rebuild'])) { @@ -151,12 +159,18 @@ class eurl_admin_ui extends e_admin_controller_ui public function simplePage() { // $this->addTitle("Simple Redirects"); - $eUrl =e107::getAddonConfig('e_url'); + $eUrl =e107::getAddonConfig('e_url'); if(empty($eUrl)) { return; } + + + + + + $text = ""; diff --git a/e107_handlers/e107_class.php b/e107_handlers/e107_class.php index 4a1d959a8..37a76bd7d 100644 --- a/e107_handlers/e107_class.php +++ b/e107_handlers/e107_class.php @@ -2617,9 +2617,7 @@ class e107 if(varset($tmp[$plugin][$key]['sef'])) { - $mode = 'sef'; //TODO Auto-detect when mod-rewrite is active. - - if($mode == 'sef') // Search-Engine-Friendly URL + if(deftrue('e_MOD_REWRITE')) // Search-Engine-Friendly URL { $rawUrl = $tp->simpleParse($tmp[$plugin][$key]['sef'], $row); return e_HTTP.$rawUrl; @@ -3004,6 +3002,8 @@ class e107 define('CHARSET', 'utf-8'); // set CHARSET for backward compatibility + define('e_MOD_REWRITE', (getenv('HTTP_MOD_REWRITE')=='On' ? true : false)); + // Define the domain name and subdomain name. if(is_numeric(str_replace(".","",$_SERVER['HTTP_HOST']))) {