bludit/bl-kernel/boot/rules/60.router.php

16 lines
407 B
PHP
Raw Normal View History

2018-09-11 23:37:45 +02:00
<?php defined('BLUDIT') or die('Bludit CMS.');
// Redirect admin, from /admin to /admin/
if ($url->uri()=='/'.ADMIN_URI_FILTER) {
Redirect::url(DOMAIN_ADMIN);
}
// Redirect pages, from /my-page/ to /my-page
if ($url->whereAmI()=='page' && !$url->notFound()) {
$pageKey = $url->slug();
if (Text::endsWith($pageKey, '/')) {
$pageKey = rtrim($pageKey, '/');
Redirect::url(DOMAIN_PAGES.$pageKey);
}
}