目次

DokuWiki立ち上げ

さくらのレンタルサーバー

urlの最適化

urlの末尾を?=なんちゃらではなく、スラッシュで区切られたネームスペース、ページ名とするための変更。

  1. ./.htaccess.dist を ./.htaccessへコピーし、下記のコメントアウト部分を復活
  2. DokuWikiのサイト設定で、「URLの書き換え」を .htaccess に、「URLの名前空間の区切りにスラッシュを使用」のチェックをオンに、それぞれ変更

なお、indexmenuプラグインの「新規」でページを追加することが出来なくなるようだ(区切りのスラッシュをurlencodeしているのがだめ)。

.htaccessの変更箇所(抜粋、コメントアウトを復活させる部分のみ)

## 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

## Not all installations will require the following line.  If you do,
## change "/dokuwiki" to the path to your dokuwiki directory relative
## to your document root.
RewriteBase /

最後の行の RewiteBase / も復活させないとうまく動かなかった。

参考サイト

https://qiita.com/takaaki_kurihara/items/5b738e477f599531c740