Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm setting up an hgwebdir configuration for the first time with Mercurial on apache2. I can see the three repositories I've set up in the first page, and I've figured out how to modify their names so they don't resemble the directory path.

But when I click to go to one of the repositories, the URL becomes http://localhost/hg/hgweb.cgi/path/to/repos. I would like the directory to be http://localhost/hg/name instead as that is easier to remember for people who want to clone the repository.

Is there anyway to do that with hgwebdir?

share|improve this question

It really depends on the web server you are using.

In my case I'm using Apache and simply edited the httpd-vhosts.conf file and for the domain running hgweb.cgi set up the following Script Alias:

ScriptAlias /hg /FULL/PATH/TO/hgweb.cgi

Also I see you are referring to hgwebdir.cgi script. This has since been merged with the hgweb.cgi script since version 1.6. You can get the latest version of this file from the Mercurial source repository:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.