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

24 lines
710 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/
2018-09-12 18:21:21 +02:00
if ($url->uri()==HTML_PATH_ROOT.ADMIN_URI_FILTER) {
2018-09-11 23:37:45 +02:00
Redirect::url(DOMAIN_ADMIN);
}
2018-12-26 19:17:30 +01:00
// Redirect blog, from /blog to /blog/
// This rule only works when the user set a page as homepage
if ($url->uri()==HTML_PATH_ROOT.'blog' && $site->homepage()) {
$filter = $url->filters('blog');
$finalURL = Text::addSlashes(DOMAIN_BASE.$filter, false, true);
Redirect::url($finalURL);
}
2018-09-11 23:37:45 +02:00
// 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);
}
}