aboutsummaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
authorThomas Lange <code@nerdmind.de>2017-04-27 16:47:11 +0200
committerThomas Lange <code@nerdmind.de>2017-04-27 16:47:11 +0200
commit6c4f2a26233f7bef03ddf7ee9f59c95e88e1a601 (patch)
tree6692172b2c5fe13645b8455a9efd9b09282df79e /index.php
parent22dacc02179643ddd4578a34cf8693ef86791cf7 (diff)
downloadblog-6c4f2a26233f7bef03ddf7ee9f59c95e88e1a601.tar.gz
blog-6c4f2a26233f7bef03ddf7ee9f59c95e88e1a601.tar.xz
blog-6c4f2a26233f7bef03ddf7ee9f59c95e88e1a601.zip
Router: Regular expressions for feed URLs has been combined.
Diffstat (limited to 'index.php')
-rw-r--r--index.php16
1 files changed, 2 insertions, 14 deletions
diff --git a/index.php b/index.php
index 360bd4d..0697ed3 100644
--- a/index.php
+++ b/index.php
@@ -49,14 +49,7 @@ Router::add('', function() {
#===============================================================================
# ROUTE: Feed
#===============================================================================
-Router::add('feed/', function() {
- require 'core/include/feed/main.php';
-});
-
-#===============================================================================
-# ROUTE: Feed [item type only]
-#===============================================================================
-Router::add('feed/(page|post)/', function($param) {
+Router::add('feed/(?:(page|post)/)?', function($param = NULL) {
require 'core/include/feed/main.php';
});
@@ -70,12 +63,7 @@ Router::add('search/', function() {
#===============================================================================
# REDIRECT: Feed (trailing slash)
#===============================================================================
-Router::addRedirect('feed', Application::getURL('feed/'));
-
-#===============================================================================
-# REDIRECT: Feed [posts or pages] (trailing slash)
-#===============================================================================
-Router::addRedirect('feed/(page|post)', Application::getURL('feed/$1/'));
+Router::addRedirect('feed(/(?:page|post))?', Application::getURL('feed$1/'));
#===============================================================================
# REDIRECT: Search (trailing slash)