Index: branches/5.3.x/core/kernel/utility/http_query.php =================================================================== diff -u -N -r15650 -r15652 --- branches/5.3.x/core/kernel/utility/http_query.php (.../http_query.php) (revision 15650) +++ branches/5.3.x/core/kernel/utility/http_query.php (.../http_query.php) (revision 15652) @@ -1,6 +1,6 @@ Application->VerifyThemeId(); $this->Application->VerifyLanguageId(); } + + if ( !$this->Application->isAdmin && $this->Application->ConfigValue('ForceCanonicalUrls') ) { + $template = $this->Application->GetVar('t'); + $seo_template = $this->Application->getSeoTemplate($template); + + if ( $seo_template && $seo_template != $template ) { + $url_params = $this->getRedirectParams(); + $url_params['response_code'] = 301; + + trigger_error('Request url "' . $_SERVER['REQUEST_URI'] . '" points directly to physical template', E_USER_NOTICE); + $this->Application->Redirect($seo_template, $url_params); + } + } } /**