Index: kernel/utility/http_query.php
===================================================================
--- kernel/utility/http_query.php (revision 13400)
+++ kernel/utility/http_query.php (working copy)
@@ -234,20 +234,31 @@
function AfterInit()
{
-// $vars = $this->processQueryString($this->Get(ENV_VAR_NAME));
-// $this->AddParams($vars);
-// $this->convertPostEvents();
- // if ($this->Application->RewriteURLs()) {
- if ($this->Application->RewriteURLs() || $this->Get('_mod_rw_url_')) {
+ $rewrite_url = $this->Get('_mod_rw_url_');
+
+ if ($this->Application->RewriteURLs() || $rewrite_url) {
if (defined('DEBUG_MODE') && $this->Application->isDebugMode()) {
$this->Application->Debugger->profileStart('url_parsing');
$this->processRewriteURL();
- $description = 'Parsing MOD_REWRITE url (template: '.$this->Get('t').')';
+ $description = 'Parsing MOD_REWRITE url (template: ' . $this->Get('t') . ')';
$this->Application->Debugger->profileFinish('url_parsing', $description);
}
else {
$this->processRewriteURL();
}
+
+ if (!defined('GW_NOTIFY') && !$rewrite_url && preg_match('/[\/]{0,1}index.php[\/]{0,1}/', $_SERVER['PHP_SELF'])) {
+ // not in payment gateway notification script AND
+ // rewrite url is missing AND not a script from tools folder AND
+ // "index.php" was visited
+ $url_params = $this->getRedirectParams();
+
+ // no idea about how to check, that given template require category to be passed with it, so pass anyway
+ $url_params['pass_category'] = 1;
+ $url_params['response_code'] = 301; // Moved Permanently
+
+ $this->Application->Redirect('', $url_params);
+ }
}
else {
$this->Application->VerifyLanguageId();