From dfc2844214adf30dbf0f11cf528823047aede785 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Wed, 10 Feb 2021 17:58:36 +0100 Subject: [PATCH] distgit/pagure: redirect users viewing files in the old default branch to the new default one Fixes https://pagure.io/fedora-infrastructure/issue/9620 Signed-off-by: Pierre-Yves Chibon --- roles/distgit/pagure/templates/z_pagure.conf | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/roles/distgit/pagure/templates/z_pagure.conf b/roles/distgit/pagure/templates/z_pagure.conf index 7e4806643b..2a7f5deec3 100644 --- a/roles/distgit/pagure/templates/z_pagure.conf +++ b/roles/distgit/pagure/templates/z_pagure.conf @@ -30,6 +30,14 @@ WSGIProcessGroup pagureproc # +# Redirect files viewed in master to the main branch +# https://pagure.io/fedora-infrastructure/issue/9620 +RedirectMatch 302 (.*)/rpms/(.*)blob/master/(.*) $1/rpms/$2/blob/rawhide/$3 +RedirectMatch 302 (.*)/container/(.*)blob/master/(.*) $1/container/$2/blob/rawhide/$3 +RedirectMatch 302 (.*)/flatpaks/(.*)blob/master/(.*) $1/flatpaks/$2/blob/stable/$3 +RedirectMatch 302 (.*)/tests/(.*)blob/master/(.*) $1/tests/$2/blob/main/$3 + + RewriteEngine on # First try the instance-specific theme