web:dokuwiki:directory
サブディレクトリにインストールしたDokuWikiをルートで表示
https://www.example.com/dw にインストールしたDokuWikiを https://www.example.com で表示する例です。
サイトの設定
URLの置き換え | .htaccess |
サーバのパス | / |
サーバのURL | https://www.example.com |
.htaccess の変更
DokuWikiのインストールファイル内に「.htaccess.dist」があるので、FTPソフトでダウンロードし、ファイル名の変更で「.dist」部分を消すことでテンプレをベースに作成できます。必要箇所のコメントアウトを外しながら入力の値を変えます。
ルートディレクトリとインストール先のディレクトリの2つを追加する必要があります。
「dw」はインストール先のディレクトリ名なので、環境に応じて適宜変更してください。
ルートディレクトリ
RewriteEngine on RewriteBase / RewriteRule ^$ dw/ [L] RewriteRule (.*) dw/$1 [L]
インストール先の.htaccess
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 RewriteBase /dw
参考
スポンサーリンク
web/dokuwiki/directory.txt · 最終更新: 2023/10/25 01:04 by Shohei Okuda