このページの2つのバージョン間の差分を表示します。
次のリビジョン | 前のリビジョン | ||
dokuwiki:04_hide_doku.php [2015/08/26 03:32] – 作成 matsui | dokuwiki:04_hide_doku.php [2015/10/07 00:30] (現在) – 外部編集 127.0.0.1 | ||
---|---|---|---|
行 1: | 行 1: | ||
+ | ====== 04 doku.phpを隠す ====== | ||
+ | |||
+ | |||
+ | http:// | ||
+ | 上記のようなURLを、下記のように表示する事ができます。 | ||
+ | http:// | ||
+ | |||
+ | ===== ①local.php 修正===== | ||
+ | |||
+ | <code console> | ||
+ | # vi conf/ | ||
+ | $conf[' | ||
+ | </ | ||
+ | |||
+ | ===== ②.htaccess 修正 ===== | ||
+ | |||
+ | 以下のようにコメントアウトを外してあげる | ||
+ | |||
+ | <code bash> | ||
+ | ## Enable this to restrict editing to logged in users only | ||
+ | |||
+ | ## You should disable Indexes and MultiViews either here or in the | ||
+ | ## global config. Symlinks maybe needed for URL rewriting. | ||
+ | #Options -Indexes -MultiViews +FollowSymLinks | ||
+ | |||
+ | ## make sure nobody gets the htaccess, README, COPYING or VERSION files | ||
+ | <Files ~ " | ||
+ | Order allow,deny | ||
+ | Deny from all | ||
+ | Satisfy All | ||
+ | </ | ||
+ | |||
+ | ## Uncomment these rules if you want to have nice URLs using | ||
+ | ## $conf[' | ||
+ | # | ||
+ | RewriteEngine on | ||
+ | # | ||
+ | ## Not all installations will require the following line. If you do, | ||
+ | ## change "/ | ||
+ | ## to your document root. | ||
+ | # | ||
+ | RewriteBase / | ||
+ | # | ||
+ | ## If you enable DokuWikis XML-RPC interface, you should consider to | ||
+ | ## restrict access to it over HTTPS only! Uncomment the following two | ||
+ | ## rules if your server setup allows HTTPS. | ||
+ | RewriteCond %{HTTPS} !=on | ||
+ | RewriteRule ^lib/ | ||
+ | |||
+ | RewriteRule ^_media/ | ||
+ | RewriteRule ^_detail/ | ||
+ | RewriteRule ^_export/ | ||
+ | RewriteRule ^$ doku.php | ||
+ | RewriteCond %{REQUEST_FILENAME} | ||
+ | RewriteCond %{REQUEST_FILENAME} | ||
+ | RewriteRule (.*) doku.php? | ||
+ | RewriteRule ^index.php$ | ||
+ | </ | ||
+ | |||
+ | |||
+ | ==== userwrite = 2 から変更した場合 ==== | ||
+ | |||
+ | [userwrite = 2] (Dokuwikiによる設定)から変更する場合は、元のURLリンクからたどると、全部トップページになってしまいます。 | ||
+ | |||
+ | http:// | ||
+ | 上記のURLから下のURLへ | ||
+ | http:// | ||
+ | |||
+ | |||
+ | === 対処 === | ||
+ | |||
+ | 下記の行を入れてあげると、元のURLもそのまま利用できます。 | ||
+ | < | ||
+ | RewriteRule ^doku.php(.*) | ||
+ | </ | ||
+ | |||
+ | こんな感じで | ||
+ | <code bash> | ||
+ | RewriteRule ^_media/ | ||
+ | RewriteRule ^_detail/ | ||
+ | RewriteRule ^_export/ | ||
+ | RewriteRule ^$ doku.php | ||
+ | RewriteRule ^doku.php(.*) | ||
+ | RewriteCond %{REQUEST_FILENAME} | ||
+ | RewriteCond %{REQUEST_FILENAME} | ||
+ | RewriteRule (.*) doku.php? | ||
+ | RewriteRule ^index.php$ | ||
+ | </ | ||
+ | |||
+ | {{tag> | ||