While in the process of setting up a Dokuwiki install I came across a problem with generating clean URLs using Apache rewriting.

The installation comes with a default .htaccess which is,

RewriteEngine on
 
RewriteBase /dokuwiki
 
RewriteRule ^_media/(.*)              lib/exe/fetch.php?media=$1  [QSA,L]
RewriteRule ^_detail/(.*)             lib/exe/detail.php?media=$1  [QSA,L]
RewriteRule ^_export/([^/]+)/(.*)     doku.php?do=export_$1&id=$2  [QSA,L]
RewriteRule ^$                        doku.php  [L]
RewriteCond %{REQUEST_FILENAME}       !-f
RewriteCond %{REQUEST_FILENAME}       !-d
RewriteRule (.*)                      doku.php?id=$1  [QSA,L]
RewriteRule ^index.php$               doku.php

However on 1and1 shared hosting when serving Dokuwiki directly from the domain root directory I need the following change,

RewriteEngine on
 
RewriteBase /
 
RewriteRule ^_media/(.*)              lib/exe/fetch.php?media=$1  [QSA,L]
RewriteRule ^_detail/(.*)             lib/exe/detail.php?media=$1  [QSA,L]
RewriteRule ^_export/([^/]+)/(.*)     doku.php?do=export_$1&id=$2  [QSA,L]
RewriteRule ^$                        doku.php  [L]
RewriteCond %{REQUEST_FILENAME}       !-f
RewriteCond %{REQUEST_FILENAME}       !-d
RewriteRule (.*)                      doku.php?id=$1  [QSA,L]
RewriteRule ^index.php$               doku.php

While the moment I thought of this it became obvious the documentation within the file suggest this is an unlikely value to edit and also presents it elsewhere to the RewriteEngine so not as obvious as I thought it could be.

New Glass Lumix H014AE

New glass for the new camera. Continue reading

Getting a new camera

Published on July 05, 2018

An Image Building and Sky

Published on June 10, 2018