Like the suggested per-user rewrite rule in the ~gitweb(1)~ manual
page, the second ~RewriteRule~ specifies the root directory of the
user's public Git repositories via the ~GITWEB_PROJECTROOT~
-environment variable. It makes ~http://www/~dick/gitweb.cgi~ run
+environment variable. It makes ~http://www/~dick/git~ run
Gitweb with the project root =~dick/Public/Git/=, the same directory
the ~git-daemon~ makes available. The first ~RewriteRule~ directs
-URLs with no user name to the default. Thus ~http://www/gitweb.cgi~
-lists the repositories found in =/var/www/git/=. The match patterns
-of both rules recognize =/gitweb= as well as =/gitweb.cgi=.
+URLs with no user name to the default. Thus ~http://www/git~
+lists the repositories found in =/var/www/git/=.
#+NAME: apache-gitweb
#+CAPTION: ~apache-gitweb~
Options MultiViews
</Directory>
RewriteEngine on
-RewriteRule ^/gitweb(\.cgi)?(/.*)?$ \
- /cgi-bin/gitweb.cgi$2 [QSA,L,PT]
-RewriteRule ^/\~([^\/]+)/gitweb(\.cgi)?(/.*)?$ \
- /cgi-bin/gitweb.cgi$3 \
+RewriteRule ^/git(/.*)?$ \
+ /cgi-bin/gitweb.cgi$1 [QSA,L,PT]
+RewriteRule ^/\~([^\/]+)/git(/.*)?$ \
+ /cgi-bin/gitweb.cgi$2 \
[QSA,E=GITWEB_PROJECTROOT:/home/$1/Public/Git/,L,PT]
#+END_SRC
Options MultiViews
</Directory>
RewriteEngine on
- RewriteRule ^/gitweb(\.cgi)?(/.*)?$ \
- /cgi-bin/gitweb.cgi$2 [QSA,L,PT]
- RewriteRule ^/\~([^\/]+)/gitweb(\.cgi)?(/.*)?$ \
- /cgi-bin/gitweb.cgi$3 \
+ RewriteRule ^/git(/.*)?$ \
+ /cgi-bin/gitweb.cgi$1 [QSA,L,PT]
+ RewriteRule ^/\~([^\/]+)/git(/.*)?$ \
+ /cgi-bin/gitweb.cgi$2 \
[QSA,E=GITWEB_PROJECTROOT:/home/$1/Public/Git/,L,PT]
dest: /etc/apache2/sites-available/live-vhost.conf
mode: u=rw,g=r,o=r
Options MultiViews
</Directory>
RewriteEngine on
- RewriteRule ^/gitweb(\.cgi)?(/.*)?$ \
- /cgi-bin/gitweb.cgi$2 [QSA,L,PT]
- RewriteRule ^/\~([^\/]+)/gitweb(\.cgi)?(/.*)?$ \
- /cgi-bin/gitweb.cgi$3 \
+ RewriteRule ^/git(/.*)?$ \
+ /cgi-bin/gitweb.cgi$1 [QSA,L,PT]
+ RewriteRule ^/\~([^\/]+)/git(/.*)?$ \
+ /cgi-bin/gitweb.cgi$2 \
[QSA,E=GITWEB_PROJECTROOT:/home/$1/Public/Git/,L,PT]
dest: /etc/apache2/sites-available/test-vhost.conf
mode: u=rw,g=r,o=r
Options MultiViews
</Directory>
RewriteEngine on
- RewriteRule ^/gitweb(\.cgi)?(/.*)?$ \
- /cgi-bin/gitweb.cgi$2 [QSA,L,PT]
- RewriteRule ^/\~([^\/]+)/gitweb(\.cgi)?(/.*)?$ \
- /cgi-bin/gitweb.cgi$3 \
+ RewriteRule ^/git(/.*)?$ \
+ /cgi-bin/gitweb.cgi$1 [QSA,L,PT]
+ RewriteRule ^/\~([^\/]+)/git(/.*)?$ \
+ /cgi-bin/gitweb.cgi$2 \
[QSA,E=GITWEB_PROJECTROOT:/home/$1/Public/Git/,L,PT]
dest: /etc/apache2/sites-available/www-vhost.conf
mode: u=rw,g=r,o=r
Options MultiViews
</Directory>
RewriteEngine on
- RewriteRule ^/gitweb(\.cgi)?(/.*)?$ \
- /cgi-bin/gitweb.cgi$2 [QSA,L,PT]
- RewriteRule ^/\~([^\/]+)/gitweb(\.cgi)?(/.*)?$ \
- /cgi-bin/gitweb.cgi$3 \
+ RewriteRule ^/git(/.*)?$ \
+ /cgi-bin/gitweb.cgi$1 [QSA,L,PT]
+ RewriteRule ^/\~([^\/]+)/git(/.*)?$ \
+ /cgi-bin/gitweb.cgi$2 \
[QSA,E=GITWEB_PROJECTROOT:/home/$1/Public/Git/,L,PT]
IncludeOptional /etc/letsencrypt/options-ssl-apache.conf