From 210577e95105a950f40367fbf748228d7c40c3f7 Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Fri, 25 May 2018 13:22:33 +0200 Subject: Add redirects for plain /threads and /messages URL It is against the best practices to use URLs whose initial components trigger 404. Instead, cause 'empty' /threads and /messages to redirect to top page. Bug: https://bugs.gentoo.org/656386 --- ag-web.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ag-web.rb b/ag-web.rb index fc09fb6..2dc8fe7 100644 --- a/ag-web.rb +++ b/ag-web.rb @@ -101,6 +101,10 @@ get '/:list/' do end end +get '/:list/(threads|messages)/?' do + redirect '/%s/' % [params[:list]] +end + get '/:list/threads/:year-:month' do redirect '/%s/threads/%s-%s/' % [params[:list], params[:year], params[:month]] end -- cgit v1.2.3-65-gdbad