]> Lady’s Gitweb - Gitweb/commitdiff
gitweb setup instruction: rewrite HEAD and root as well
authorAsk Bjørn Hansen <redacted>
Sat, 7 Jun 2008 07:19:26 +0000 (00:19 -0700)
committerLady <redacted>
Mon, 6 Apr 2026 04:07:33 +0000 (00:07 -0400)
Also add a few more hints for how to setup and configure gitweb as described

[jc: with a fix from Mike Hommey]

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

diff --git a/README b/README
index 103067ea0209d26d52ac79376ac5d9bc171fe7081b050dc796726e2db22fe74c..1d15114d418ede0ca447b83bea63732c93bf0fb0c258c75ceba6996eaa035b46 100644 (file)
--- a/README
+++ b/README
@@ -254,12 +254,15 @@ Webserver configuration
 If you want to have one URL for both gitweb and your http://
 repositories, you can configure apache like this:
 
 If you want to have one URL for both gitweb and your http://
 repositories, you can configure apache like this:
 
-<VirtualHost www:80>
-    ServerName git.domain.org
+<VirtualHost *:80>
+    ServerName git.example.org
     DocumentRoot /pub/git
     DocumentRoot /pub/git
-    RewriteEngine on
-    RewriteRule ^/(.*\.git/(?!/?(info|objects|refs)).*)?$ /cgi-bin/gitweb.cgi%{REQUEST_URI}  [L,PT]
     SetEnv     GITWEB_CONFIG   /etc/gitweb.conf
     SetEnv     GITWEB_CONFIG   /etc/gitweb.conf
+    RewriteEngine on
+    # make the front page an internal rewrite to the gitweb script
+    RewriteRule ^/$  /cgi-bin/gitweb.cgi
+    # make access for "dumb clients" work
+    RewriteRule ^/(.*\.git/(?!/?(HEAD|info|objects|refs)).*)?$ /cgi-bin/gitweb.cgi%{REQUEST_URI}  [L,PT]
 </VirtualHost>
 
 The above configuration expects your public repositories to live under
 </VirtualHost>
 
 The above configuration expects your public repositories to live under
@@ -275,6 +278,13 @@ override the defaults given at the head of the gitweb.perl (or
 gitweb.cgi).  Look at the comments in that file for information on
 which variables and what they mean.
 
 gitweb.cgi).  Look at the comments in that file for information on
 which variables and what they mean.
 
+If you use the rewrite rules from the example you'll likely also need
+something like the following in your gitweb.conf (or gitweb_config.perl) file:
+
+  @stylesheets = ("/some/absolute/path/gitweb.css");
+  $my_uri = "/";
+  $home_link = "/";
+
 
 Originally written by:
   Kay Sievers <kay.sievers@vrfy.org>
 
 Originally written by:
   Kay Sievers <kay.sievers@vrfy.org>
This page took 0.165306 seconds and 4 git commands to generate.