[dokuwiki] Re: Patch attached: Optionally add a filetype to wikipage urls, e.g. .html to look like static html

  • From: Helmut Tischer <htischer@xxxxxxxxxxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Mon, 23 Feb 2009 23:27:21 +0100

Hi Andy,

thank you for picking this up timely after the big release.

wikipage_filetype_suffix

Optionally add a filetype to wikipage urls, e.g. .html
In rewrite URL mode, this makes wiki pages look like static html.

Andreas Gohr schrieb:

... why? ...
web tools do not care for extensions. It's the
content-type header that counts. ...

Yes, indeed this completion of "nice urls" in addition to $conf['userewrite']=1 and $conf['useslash']=1 was not meant about mime types.

It is about meeting the expectations of not so technical readers.

Like the world talks and knows about "www", even though this is only an arbitrary server name, while the important part is "http://";.

For example if there is a search result or someone sends a "funny" link, my motivation to follow the link by sure depends on whether it pretends to be a .jpg, .doc, .ppt, .pdf or unpredictable filetype where I only know that it is a html if I know that the destination site is a DokuWiki, and in this case no ending means actually html.

(Of course, if the pretended extension is maliciously wrong, I still get a surprising Browser "Safe as" dialog).

As side effect fixes $conf['userewrite']==1 with $conf['useslash']==0
on windows host with ';' namespace separator.

Can you explain? What exactly does it fix?

Yes, in the above case the folder delimiter is ":". On Windows host this has a special meaning as drive name separator. Therefore DokuWiki in idfilter() already contained code to instead use ";" as folder delimiter.
However this was not applied consistently.
In getID() the ";" was not treated, and such in this case the translation of an URL to an internal $ID did not work.

Also in idfilter() after rawurlencode() replacing the encoded '%3B' back to ';' was missing.

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

Other related posts: