====== urlの書き換え ====== DokuWiki のデフォルト設定では URL を書き換えず、URL はこんな感じになります: http://example.com/doku.php?id=page これを以下のようなurlになるよう変更します http://example.com/page ===== 設定 ===== - dokuwiki関連用設定ファイルに以下を追記 * # rewrites for dokuwiki $HTTP["url"] =~ "^/" { index-file.names = ("doku.php") } url.rewrite-once = ( "^/lib/.*$" => "$0", "^/_media/(.*)?\?(.*)$" => "/lib/exe/fetch.php?media=$1&$2", "^/_media/(.*)$" => "/lib/exe/fetch.php?media=$1", "^/_detail/(.*)?\?(.*)$" => "/lib/exe/detail.php?media=$1&$2", "^/_detail/(.*)?$" => "/lib/exe/detail.php?media=$1", "^/_export/([^/]+)/(.*)\?(.*)$" => "/doku.php?do=export_$1&id=$2&$3", "^/_export/([^/]+)/(.*)" => "/doku.php?do=export_$1&id=$2", "^/doku.php.*" => "$0", "^/feed.php.*" => "$0", "^/(.*)\?(.*)" => "/doku.php?id=$1&$2", "^/(.*)" => "/doku.php?id=$1" ) - lighttpdのモジュール設定ファイルでrewriteモジュールを設定 * server.modules = ( "mod_rewrite", <= コメントを外して生かす "mod_access", # "mod_evasive", # "mod_auth", # "mod_authn_file", # "mod_redirect", # "mod_setenv", # "mod_alias", ) ===== 設定 ===== dokuwikiの設定画面で以下の設定を行います * URLの書き換え: .htaccess * URL上の名前空間の区切りにスラッシュを使用 [x] ===== lighttpdの再起動 ===== service lighttpd restart ===== 参考 ===== * [[https://www.dokuwiki.org/install:lighttpd_config_example|Lighttpd example config]]