diff options
author | Michał Górny <mgorny@gentoo.org> | 2018-05-25 13:22:33 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2018-05-25 13:22:33 +0200 |
commit | 210577e95105a950f40367fbf748228d7c40c3f7 (patch) | |
tree | 138b7bd8730da2701cc2205cdd64a73aaa4010ed | |
parent | Add redirects for missing/extraneous trailing slashes (diff) | |
download | frontend-210577e95105a950f40367fbf748228d7c40c3f7.tar.gz frontend-210577e95105a950f40367fbf748228d7c40c3f7.tar.bz2 frontend-210577e95105a950f40367fbf748228d7c40c3f7.zip |
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
-rw-r--r-- | ag-web.rb | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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 |