[dokuwiki] Media files combined with basedir and userewrite=2

  • From: Jan Decaluwe <jan@xxxxxxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Mon, 10 Oct 2005 10:11:21 +0200

I have a problem :-)

First the context: I have a dokuwiki installed in a
top-level directory called "myhdl". On my host I
can define a subdomain as follows:

  www.jandecaluwe.com/myhdl -> myhdl.jandecaluwe.com

To support this with dokuwiki, I configure basedir:

   conf['basedir'] = "//";

This may seem a trick, but it works fine in general. I
also use php-based url rewriting:

   conf['userewrite'] = 2

Everything works, except downloading .tar.gz files.
The lib/exe/fetch.php script gives me a Bad Request.
The culprit is the getID function (pageutils.php).
For my case, it constructs the script as follows:

   $script = $conf['basedir'].basename($_SERVER['SCRIPT_FILENAME']);

It seems obvious that this will work for top-level scripts
such as doku.php, but not for lower level ones such as
lib/exe/fetch.php.

I see various ways to fix this, but not an entirely satisfactory
solution yet. Some possibilities:

* put all scripts at the top-level
* explicty try "lib/exe" in the script url also
* more liberal regexp matching using only the script basename
* not using url rewriting on media files

Any suggestions?

Regards,
Jan

--
Jan Decaluwe - Resources bvba - http://www.jandecaluwe.com
Losbergenlaan 16, B-3010 Leuven, Belgium
    Electronic design with Python:
    http://myhdl.jandecaluwe.com

--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: