Skip to content

Commit

Permalink
Merge pull request Uberspace#1244 from cblte/patch-3
Browse files Browse the repository at this point in the history
Update guide_dokuwiki.rst
  • Loading branch information
noave authored Dec 29, 2022
2 parents 0bbca74 + 7f7cbc6 commit e1d7e5e
Showing 1 changed file with 78 additions and 0 deletions.
78 changes: 78 additions & 0 deletions source/guide_dokuwiki.rst
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,84 @@ Tuning
For plugins, themes and other stuff go to DokuWiki_.


Nice URLs aka URL-Rewriting
---------------------------

To change default behaviour and rewrite ``https://isabell.uber.space/doku.php?id=dokuwiki-on-uberspace`` to ``https://isabell.uber.space/dokuwiki-on-uberspace`` you need to enable URL rewriting in /var/www/virtual/$USER/html/conf/local.php/ file by appending:

::
$conf['userewrite'] = 1;
$conf['useslash'] = 1;

This can also be done in Configuration Settings via Admin page.

Next step is to rename ``/var/www/virtual/$USER/html/.htaccess.dist`` to ``/var/www/virtual/$USER/html/.htaccess`` and edit that file. First uncomment:

::
#RewriteEngine On

by deleting the # character at the beginning of the line and insert:

::
RewriteBase /

between ``RewriteEngine On`` and first ``RewriteRule`` directive. Finally uncomment all of the following rewrite rules and save changes.

Before:

::

## Uncomment these rules if you want to have nice URLs using
## $conf['userewrite'] = 1 - not needed for rewrite mode 2
#RewriteEngine on
#
#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
#

After:

::
## Uncomment these rules if you want to have nice URLs using
## $conf['userewrite'] = 1 - not needed for rewrite mode 2
RewriteEngine on
#
## Change RewriteBase to the directory your dokuwiki installation points to
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
#

If something goes wrong, you can set the two values to 0 and delete the ``.htaccess`` file.


Handling Special Characters
---------------------------

Special characters should be handled safe to avoid long or corrupt filenames. Edit ``/var/www/virtual/$USER/html/conf/local.php/`` by appending:

::

$conf['fnencode'] = 'safe';


Updates
=======

Expand Down

0 comments on commit e1d7e5e

Please sign in to comment.