aboutsummaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'index.php')
-rw-r--r--index.php22
1 files changed, 5 insertions, 17 deletions
diff --git a/index.php b/index.php
index a7d0ce6..8f34047 100644
--- a/index.php
+++ b/index.php
@@ -33,28 +33,16 @@ Router::add('', function() {
});
#===============================================================================
-# ROUTE: Feed
+# ROUTE: Feed and Search
#===============================================================================
-Router::add('feed/', function() {
- require 'core/include/feed/main.php';
+Router::add('(feed|search)/', function($slug) {
+ require "core/include/{$slug}/main.php";
});
#===============================================================================
-# ROUTE: Search
+# REDIRECT: Feed and Search (trailing slash)
#===============================================================================
-Router::add('search/', function() {
- require 'core/include/search/main.php';
-});
-
-#===============================================================================
-# REDIRECT: Feed (trailing slash)
-#===============================================================================
-Router::addRedirect('feed', Application::getURL('feed/'));
-
-#===============================================================================
-# REDIRECT: Search (trailing slash)
-#===============================================================================
-Router::addRedirect('search', Application::getURL('search/'));
+Router::addRedirect('(feed|search)', Application::getURL('$1/'));
#===============================================================================
# REDIRECT: Favicon