summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2018-05-30 20:04:09 +0200
committerMichał Górny <mgorny@gentoo.org>2018-05-30 20:04:09 +0200
commitf0c27b4629255863e1cccda653c2d1db20e95659 (patch)
tree35994b3f187d7e9c37b697c46233e7ea57cc4631
parentRemove the awful redirect on no messages in month (diff)
downloadfrontend-f0c27b4629255863e1cccda653c2d1db20e95659.tar.gz
frontend-f0c27b4629255863e1cccda653c2d1db20e95659.tar.bz2
frontend-f0c27b4629255863e1cccda653c2d1db20e95659.zip
Try to use 301 (permanent) redirects for address rewrites
-rw-r--r--ag-web.rb12
1 files 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