About Download Docs Changes

Unable to create a link to search/somepage with plain CGI in Apache

After using the sample script provided in the zip version or writing down a file like the example provided in Plain CGI on shared hosting I had a hattarun.py working great.

Here the configuration of Apache I used :

Alias /hatta/mysite /var/lib/hatta/mysite/
<LocationMatch /hatta/.*>
    DirectoryIndex hattarun.py
    AddHandler cgi-script .py
    Options ExecCGI FollowSymLinks
</LocationMatch>

This way I can create any subfolder in /var/hatta and copy there hattarun.py to get a new wiki.

Now the url I have to type to get my wiki is http://localhost/hatta/mysite/hattarun.py.

When I manually write http://localhost/hatta/mysite/hattarun.py/search/Home in firefox it's working.

When I create a link in a wiki page like [[search/Home]] it write a url ending with http://localhost/hatta/mysite/hattarun.py/search%2FHome which is correct but once clicked Apache tries to get a file and does not run hattarun.py.

Is there a way to configure Apache or prevent URL enconding?


The problem is not url encoding. It's not done by Apache, but by Hatta, so that you can have page names with slashes in them. I tested it on apache on debian lenny, with a hatta.cgi file and a current stable Hatta (1.3.3), and it seems that:

I have to investigate further, but looks like those urls fail to match the cgi handler line.

Please note, that writing [[search/Home]] will give you a link to page called "search/Home", not backlinks of page "Home". For the latter you currently have to use external URL, with 'http' in front. Later versions of Hatta will hopefully have InterLinks to handle that.

A little googling revealed this e-mail: http://mail-archives.apache.org/mod_mbox/www-apache-bugdb/199812.mbox/%3C19981226225400.24545.qmail@hyperreal.org%3E

And I found a solution, they have an option for that:

        AllowEncodedSlashes On

See AllowEncodedSlashes