<?php switch ($modx->event->name) { case 'OnWebPagePrerender': $modx->resource->_output = str_replace('"index/', '"', $modx->resource->_output); break; case 'OnPageNotFound': $uri = explode('?', $_SERVER['REQUEST_URI']); if ($res = $modx->findResource('index' . $uri[0])) { $modx->sendForward($res); } break; case 'OnHandleRequest': if (strpos($_SERVER['REQUEST_URI'], 'index/') !== false) { $url = str_replace('index/', '', $_SERVER['REQUEST_URI']); $modx->sendRedirect($url, array('responseCode' => 'HTTP/1.1 301 Moved Permanently')); } break; default: break; } return;
Удалить index из URL ресурсов, дочерних главной
24 июля 2016, 19:29
0 комментариев