- if (substr($current_url, 0, $len) != $Config['SiteURL']) {
- dieprint_r(GENERAL_ERROR, "Edit includes/config.php and specify the correct site URL<br /><strong>Current value:</strong> $Config[SiteURL]<br /><strong>Expected value:</strong> a string starting by " . get_server_url(), "Setup");
- }
-
- //We takes the end of the URL, ie *FROM* $len position
- //Last possibility: use REQUEST_URI, but remove QUERY_STRING
- //If you need to edit here, use $_SERVER['REQUEST_URI']
- //but you need to discard $_SERVER['QUERY_STRING']
- $current_url = get_current_url();
-
- //Relevant URL part starts after the site URL
- $len = strlen($Config['SiteURL']);
-
- //We need to assert it's the correct site
- if (substr($current_url, 0, $len) != $Config['SiteURL']) {
- dieprint_r(GENERAL_ERROR, "Edit includes/config.php and specify the correct site URL<br /><strong>Current value:</strong> $Config[SiteURL]<br /><strong>Expected value:</strong> a string starting by " . get_server_url(), "Setup");
- }
-
- //We takes the end of the URL, ie *FROM* $len position
+ if (substr($current_url, 0, $len) != $Config['SiteURL']) {
+ dieprint_r(GENERAL_ERROR, "Edit includes/config.php and specify the correct site URL<br /><strong>Current value:</strong> $Config[SiteURL]<br /><strong>Expected value:</strong> a string starting by " . get_server_url(), "Setup");
+ }
+
+ if (array_key_exists('REDIRECT_URL', $_SERVER)) {
+ //With mod_rewrite, we can use REDIRECT_URL
+ //We takes the end of the URL, ie *FROM* $len position