From f0c27b4629255863e1cccda653c2d1db20e95659 Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Wed, 30 May 2018 20:04:09 +0200 Subject: Try to use 301 (permanent) redirects for address rewrites --- ag-web.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ag-web.rb b/ag-web.rb index 24111b3..5ef3522 100644 --- a/ag-web.rb +++ b/ag-web.rb @@ -102,15 +102,15 @@ get '/:list/' do end get '/:list/(threads|messages)/?' do - redirect '/%s/' % [params[:list]] + redirect '/%s/' % [params[:list]], 301 end get '/:list/threads/:year-:month' do - redirect '/%s/threads/%s-%s/' % [params[:list], params[:year], params[:month]] + redirect '/%s/threads/%s-%s/' % [params[:list], params[:year], params[:month]], 301 end get '/:list/threads/:year-:month/:page/' do - redirect '/%s/threads/%s-%s/%s' % [params[:list], params[:year], params[:month], params[:page]] + redirect '/%s/threads/%s-%s/%s' % [params[:list], params[:year], params[:month], params[:page]], 301 end get '/:list/threads/:year-:month/:page?' do @@ -143,11 +143,11 @@ get '/:list/threads/:year-:month/:page?' do end get '/:list/messages/:year-:month' do - redirect '/%s/messages/%s-%s/' % [params[:list], params[:year], params[:month]] + redirect '/%s/messages/%s-%s/' % [params[:list], params[:year], params[:month]], 301 end get '/:list/messages/:year-:month/:page/' do - redirect '/%s/messages/%s-%s/%s' % [params[:list], params[:year], params[:month], params[:page]] + redirect '/%s/messages/%s-%s/%s' % [params[:list], params[:year], params[:month], params[:page]], 301 end get '/:list/messages/:year-:month/:page?' do @@ -173,7 +173,7 @@ get '/:list/messages/:year-:month/:page?' do end get '/:list/message/:msgid/' do - redirect '/%s/message/%s' % [params[:list], params[:msgid]] + redirect '/%s/message/%s' % [params[:list], params[:msgid]], 301 end get '/:list/message/:msgid' do -- cgit v1.2.3-65-gdbad