mirror of
https://github.com/e107inc/e107.git
synced 2025-08-02 20:57:26 +02:00
Fixes #937 - detect of mod-rewrite is possible. New constant: e_MOD_REWRITE
This commit is contained in:
@@ -38,6 +38,9 @@
|
|||||||
### LimitRequestBody 10240000
|
### LimitRequestBody 10240000
|
||||||
|
|
||||||
<IfModule mod_rewrite.c>
|
<IfModule mod_rewrite.c>
|
||||||
|
|
||||||
|
SetEnv HTTP_MOD_REWRITE On
|
||||||
|
|
||||||
### enable rewrites
|
### enable rewrites
|
||||||
Options +FollowSymLinks
|
Options +FollowSymLinks
|
||||||
RewriteEngine On
|
RewriteEngine On
|
||||||
|
@@ -64,6 +64,14 @@ class eurl_admin_ui extends e_admin_controller_ui
|
|||||||
public function init()
|
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 <b>.htaccess</b> file after the line \"Rewrite Engine On\":<br /><pre>SetEnv HTTP_MOD_REWRITE On</pre>");
|
||||||
|
}
|
||||||
|
|
||||||
if(is_array($_POST['rebuild']))
|
if(is_array($_POST['rebuild']))
|
||||||
{
|
{
|
||||||
$table = key($_POST['rebuild']);
|
$table = key($_POST['rebuild']);
|
||||||
@@ -158,6 +166,12 @@ class eurl_admin_ui extends e_admin_controller_ui
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$text = "";
|
$text = "";
|
||||||
|
|
||||||
foreach($eUrl as $plug=>$val)
|
foreach($eUrl as $plug=>$val)
|
||||||
|
@@ -2617,9 +2617,7 @@ class e107
|
|||||||
|
|
||||||
if(varset($tmp[$plugin][$key]['sef']))
|
if(varset($tmp[$plugin][$key]['sef']))
|
||||||
{
|
{
|
||||||
$mode = 'sef'; //TODO Auto-detect when mod-rewrite is active.
|
if(deftrue('e_MOD_REWRITE')) // Search-Engine-Friendly URL
|
||||||
|
|
||||||
if($mode == 'sef') // Search-Engine-Friendly URL
|
|
||||||
{
|
{
|
||||||
$rawUrl = $tp->simpleParse($tmp[$plugin][$key]['sef'], $row);
|
$rawUrl = $tp->simpleParse($tmp[$plugin][$key]['sef'], $row);
|
||||||
return e_HTTP.$rawUrl;
|
return e_HTTP.$rawUrl;
|
||||||
@@ -3004,6 +3002,8 @@ class e107
|
|||||||
|
|
||||||
define('CHARSET', 'utf-8'); // set CHARSET for backward compatibility
|
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.
|
// Define the domain name and subdomain name.
|
||||||
if(is_numeric(str_replace(".","",$_SERVER['HTTP_HOST'])))
|
if(is_numeric(str_replace(".","",$_SERVER['HTTP_HOST'])))
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user