2008年8月19日火曜日

Apacheサーバのページ設定変更

(1)Webサイトのデフォルトページの設定変更:
・デフォルトページの変更:
 DirectoryIndex index.html → DirectoryIndex frontpage.php
・表示候補を優先順に列挙:
 DirectoryIndex frontpage.php headpage.shtml index.html
これで、前のページが表示できない場合、後ろのページが表示される。

(2)エラーページの設定:
エラーメッセージを独自のエラーページに置き換える記述は、
次のような形式です:
・絶対パス:
ErrorDocument (コード) (HTMLファイルの絶対パス)
例:
ErrorDocument 404 /errors/notfound.html
※上記の置き換え用のエラーページパスは、絶対パスを使う。
(http://allabout.co.jp/errors/notfound.html)

・URL:
置き換え用のエラーページは、別のWebサーバにある場合:
ErrorDocument 404 http://www.example.com/err404.html

0 件のコメント: