For this you use mod_rewrite.


In your 000-default file, for apache put

RewriteEngine on
RewriteRule ^/gitweb/([a-zA-Z0-9_\-]+\.git)/?(\?.*)?$ /cgi/bin/gitweb.cgi/$1 [PT]
RewriteCond %{HTTP_USER_AGENT} !FeedBurner
RewriteRule ^/dsawiki/rss\.rdf$ [R]
RewriteRule ^/foobar$ [R]
RewriteRule ^/$ /dsawiki [R]

Alias /gitweb /var/path/to/git/repos


RewriteEngine on#

The first line enables mod_rewrite. You also must put it in mods-enabled. See apache docs for this.


The second line (RewriteRule) allows you to use to point to your repositories. The Alias line at the bottom is also needed.

This line ends in [PT] which stands for "passthrough" (pass through to next handler). It enables post-processing of the output of RewriteRule directives using Alias, ScriptAlias, and Redirect.


This line prevents the next line from operating if the HTTP_USER_AGENT is FeedBurner. Basically, if you subscribe to my blog, you actually subscribe through FeedBurner. I of course don't want FeedBurner getting forwarded back to itself.

RewriteRule dsawiki/rss#

If you are not FeedBurner, then any requests to /dsawiki/rss.rdf get forwarded to FeedBurner. This ends in [R] because that's the end of the rule.

RewriteRule /foobar#

Going to will redirect to This is so people can go to a meaningful url instead of a port and /admin to see a Django admin panel.

RewriteRule /dsawiki#

This line forwards requests from to