ACC SHELL
<?php
class TF_Controller_Plugin_CheckUrlSlash extends Zend_Controller_Plugin_Abstract
{
/**
* @param Zend_Controller_Request_Abstract $request
*/
public function dispatchLoopStartup(Zend_Controller_Request_Abstract $request)
{
if (substr($urlPath = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), -1) != '/') {
if (!is_dir($_SERVER['REQUEST_URI']) &&
!is_file($_SERVER['REQUEST_URI']) &&
!is_link($_SERVER['REQUEST_URI']) &&
$_SERVER['REQUEST_URI'] != '/sitemap.xml')
{
$url = str_replace($urlPath, $urlPath . '/', $_SERVER['REQUEST_URI']);
header("Location: " . $url, 301);
exit('Go to ' . $url);
}
}
}
}
ACC SHELL 2018