]> Lady’s Gitweb - Gitweb/commitdiff
gitweb/README: fix AliasMatch in example
authorGiuseppe Bilotta <redacted>
Sat, 27 Jun 2009 16:24:11 +0000 (18:24 +0200)
committerLady <redacted>
Mon, 6 Apr 2026 04:50:38 +0000 (00:50 -0400)
When combining "dumb client" and human-friendly access by using the
'.git' extension to switch between the two, make sure the AliasMatch
covers the entire request. Without a full match, a request for

http://git.example.com/project/shortlog/branch..gitsomething

would result in a 404 because the server would try to access the
the project 'project/shortlog/branch.'

The solution is still not bulletproof, so document the possible failing
case.

Signed-off-by: Giuseppe Bilotta <redacted>
Signed-off-by: Junio C Hamano <redacted>
README

diff --git a/README b/README
index e17aece9ef779572f95497c9be156d616de63a99b6f4709fc89a18e4b2711ae7..32e1b4ce2894d78df84c9d49ddbbe283a884860827d500737196b2b193ed4612 100644 (file)
--- a/README
+++ b/README
@@ -376,7 +376,7 @@ named without a .git extension (e.g. /pub/git/project instead of
 
        DocumentRoot /var/www/gitweb
 
 
        DocumentRoot /var/www/gitweb
 
-       AliasMatch ^(/.*?)(\.git)(/.*)? /pub/git$1$3
+       AliasMatch ^(/.*?)(\.git)(/.*)?$ /pub/git$1$3
        <Directory /var/www/gitweb>
                Options ExecCGI
                AddHandler cgi-script cgi
        <Directory /var/www/gitweb>
                Options ExecCGI
                AddHandler cgi-script cgi
@@ -401,6 +401,14 @@ http://git.example.com/project
 
 will provide human-friendly gitweb access.
 
 
 will provide human-friendly gitweb access.
 
+This solution is not 100% bulletproof, in the sense that if some project
+has a named ref (branch, tag) starting with 'git/', then paths such as
+
+http://git.example.com/project/command/abranch..git/abranch
+
+will fail with a 404 error.
+
+
 
 Originally written by:
   Kay Sievers <kay.sievers@vrfy.org>
 
 Originally written by:
   Kay Sievers <kay.sievers@vrfy.org>
This page took 0.223416 seconds and 4 git commands to generate.