1
0
mirror of https://github.com/e107inc/e107.git synced 2025-03-14 01:19:44 +01:00

Issue #937 Allow for e_MOD_REWRITE in e107_config.php on servers which don't have the mod_env module. (needed for .htaccess detection to function.)

This commit is contained in:
Cameron 2015-04-01 02:09:25 -07:00
parent 7c602253be
commit 872678aecd
3 changed files with 27 additions and 12 deletions

View File

@ -39,7 +39,9 @@
<IfModule mod_rewrite.c>
SetEnv HTTP_MOD_REWRITE On
<IfModule mod_env.c>
SetEnv HTTP_MOD_REWRITE On
</IfModule>
### enable rewrites
Options +FollowSymLinks

View File

@ -65,11 +65,26 @@ class eurl_admin_ui extends e_admin_controller_ui
{
$htaccess = file_get_contents(e_BASE.".htaccess");
$htaccess = file_exists(e_BASE.".htaccess");
if(strpos($htaccess, 'SetEnv HTTP_MOD_REWRITE On')===false)
if(function_exists('apache_get_modules'))
{
e107::getMessage()->addWarning("Mod-rewrite is disabled. Please add the following to your <b>.htaccess</b> file after the line \"Rewrite Engine On\":<br /><pre>SetEnv HTTP_MOD_REWRITE On</pre>");
$modules = apache_get_modules();
$modRewrite = in_array('mod_rewrite', $modules );
}
else
{
$modRewrite = false;
}
if($modRewrite === false)
{
e107::getMessage()->addInfo("Apache mod_rewrite was not found on this server and is required to use this feature. ");
}
if($htaccess && $modRewrite && !deftrue('e_MOD_REWRITE'))
{
e107::getMessage()->addInfo("Mod-rewrite is disabled. To enable, please add the following line to your <b>e107_config.php</b> file:<br /><pre>define('e_MOD_REWRITE',true);</pre>");
}
if(is_array($_POST['rebuild']))
@ -155,7 +170,8 @@ class eurl_admin_ui extends e_admin_controller_ui
$this->addTitle(LAN_EURL_NAME_HELP);
return LAN_EURL_UC;
}
//TODO Checkbox for each plugin to enable/disable
public function simplePage()
{
// $this->addTitle("Simple Redirects");
@ -167,11 +183,6 @@ class eurl_admin_ui extends e_admin_controller_ui
}
$text = "";
foreach($eUrl as $plug=>$val)

View File

@ -3006,8 +3006,10 @@ class e107
define('CHARSET', 'utf-8'); // set CHARSET for backward compatibility
define('e_MOD_REWRITE', (getenv('HTTP_MOD_REWRITE')=='On' ? true : false));
if(!defined('e_MOD_REWRITE')) // Allow e107_config.php to override.
{
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'])))
{