diff options
author | Thomas Lange <code@nerdmind.de> | 2017-04-27 16:47:11 +0200 |
---|---|---|
committer | Thomas Lange <code@nerdmind.de> | 2017-04-27 16:47:11 +0200 |
commit | 6c4f2a26233f7bef03ddf7ee9f59c95e88e1a601 (patch) | |
tree | 6692172b2c5fe13645b8455a9efd9b09282df79e | |
parent | 22dacc02179643ddd4578a34cf8693ef86791cf7 (diff) | |
download | blog-6c4f2a26233f7bef03ddf7ee9f59c95e88e1a601.tar.gz blog-6c4f2a26233f7bef03ddf7ee9f59c95e88e1a601.tar.xz blog-6c4f2a26233f7bef03ddf7ee9f59c95e88e1a601.zip |
Router: Regular expressions for feed URLs has been combined.
-rw-r--r-- | index.php | 16 |
1 files changed, 2 insertions, 14 deletions
@@ -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) |