diff --git a/modules/openstack_project/files/git-redirect.htaccess b/modules/openstack_project/files/git-redirect.htaccess index 0384d02cbb..178b23ae14 100644 --- a/modules/openstack_project/files/git-redirect.htaccess +++ b/modules/openstack_project/files/git-redirect.htaccess @@ -61,6 +61,11 @@ RewriteRule "^cgit/(.*?)/(.*?)/tree/?(.*)" "https://opendev.org/$1/$2/src/branch RewriteCond %{QUERY_STRING} id=([\w]+) RewriteRule "^cgit/(.*?)/(.*?)/plain/?$" "https://opendev.org/$1/$2/src/commit/%1/$3" [L,QSD] +# h= +# we have a commit pointed for a head +RewriteCond %{QUERY_STRING} h=([0-9a-f]{40}) +RewriteRule "^cgit/(.*?)/(.*?)/plain/?$" "https://opendev.org/$1/$2/src/commit/%1/$3" [L,QSD] + # h= # if there's no commit, but a branch: RewriteCond %{QUERY_STRING} h=([\w/]+) @@ -78,6 +83,11 @@ RewriteRule "^cgit/(.*?)/(.*?)/plain/?$" "https://opendev.org/$1/$2/src/branch/m RewriteCond %{QUERY_STRING} id=([\w]+) RewriteRule "^cgit/(.*?)/(.*?)/plain/?(.*)" "https://opendev.org/$1/$2/raw/commit/%1/$3" [L,QSD] +# h= +# we have a commit pointed for a head +RewriteCond %{QUERY_STRING} h=([0-9a-f]{40}) +RewriteRule "^cgit/(.*?)/(.*?)/plain/?(.*)$" "https://opendev.org/$1/$2/raw/commit/%1/$3" [L,QSD] + # h= # if there's no commit, but a branch: RewriteCond %{QUERY_STRING} h=([\w/]+)