redirect /blog to /blog/
This commit is contained in:
parent
74b68e507a
commit
be5a8ad517
|
@ -5,6 +5,14 @@ if ($url->uri()==HTML_PATH_ROOT.ADMIN_URI_FILTER) {
|
||||||
Redirect::url(DOMAIN_ADMIN);
|
Redirect::url(DOMAIN_ADMIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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);
|
||||||
|
}
|
||||||
|
|
||||||
// Redirect pages, from /my-page/ to /my-page
|
// Redirect pages, from /my-page/ to /my-page
|
||||||
if ($url->whereAmI()=='page' && !$url->notFound()) {
|
if ($url->whereAmI()=='page' && !$url->notFound()) {
|
||||||
$pageKey = $url->slug();
|
$pageKey = $url->slug();
|
||||||
|
|
|
@ -355,7 +355,7 @@ class Site extends dbJSON {
|
||||||
public function homepage()
|
public function homepage()
|
||||||
{
|
{
|
||||||
$homepage = $this->getField('homepage');
|
$homepage = $this->getField('homepage');
|
||||||
if( empty($homepage) ) {
|
if (empty($homepage)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return $homepage;
|
return $homepage;
|
||||||
|
|
Loading…
Reference in New Issue