Skip to content

Commit 2af077b

Browse files
committed
Added rewrite rules for commit and file reference
1 parent 43af6a6 commit 2af077b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

recipes/files/etc/apache2/sites-available/git.ruby-lang.org.conf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@
1818

1919
TimeOut 300
2020

21+
RewriteEngine On
22+
RewriteCond %{QUERY_STRING} ^id=([0-9a-fA-F]{40})$
23+
RewriteRule ^/ruby\.git/commit/?$ https://github.com/ruby/ruby/commit/%1 [R=permanent,L,NE,QSD]
24+
RewriteCond %{QUERY_STRING} ^id=([0-9a-fA-F]{40})$
25+
RewriteRule ^/ruby\.git/commit/(.*)$ https://github.com/ruby/ruby/blob/%1/$1 [R=permanent,L,NE,QSD]
26+
RewriteCond %{QUERY_STRING} ^id=([0-9a-fA-F]{40})$
27+
RewriteRule ^/ruby\.git/tree/(.*)$ https://github.com/ruby/ruby/blob/%1/$1 [R=permanent,L,NE,QSD]
28+
RewriteCond %{QUERY_STRING} ^id=([0-9a-fA-F]{40})(&showmsg=1)?$
29+
RewriteRule ^/ruby\.git/log/(.*)$ https://github.com/ruby/ruby/commits/%1/$1 [R=permanent,L,NE,QSD]
30+
2131
Alias /cgit-css "/usr/share/cgit/"
2232
Alias /robots.txt "/var/www/git.ruby-lang.org/robots.txt"
2333

0 commit comments

Comments
 (0)