hgwebdir.cgi & clean urls

Thomas Arendsen Hein thomas at intevation.de
Mon Mar 3 12:12:35 CST 2008


* Oliver Ve??ernik <ov at vecernik.at> [20080303 17:22]:
> My repos are accessible at <http://hg.vecernik.at/>, but all the generated 
> links still include hgwebdir.cgi, which I don't want.  I also tried to change 
> baseurl in hgrc, but didn't succeed.  Is there a possibility to get clean 
> urls?

I added this to my hgwebdir.cgi:
os.environ["SCRIPT_NAME"] = os.getenv("SCRIPT_URL")[:-len(os.getenv("PATH_INFO", ""))]

But you can probably just say os.environ["SCRIPT_NAME"] = ""
(or maybe = "/"?). I run additional instances of the same file
in subdirectories, e.g. /mirrors and /beta, to provide different
views, therefore I need to take PATH_INFO into account.

The full script is viewable at http://hg.intevation.org/files/hgwebdir.cgi

Thomas

-- 
thomas at intevation.de - http://intevation.de/~thomas/ - OpenPGP key: 0x5816791A
Intevation GmbH, Osnabrueck - Register: Amtsgericht Osnabrueck, HR B 18998
Geschaeftsfuehrer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner


More information about the Mercurial mailing list