さくらインターネット 503メンテナンス画面の出し方、設定

これも結構はまった・・・
さくらインターネットはApache1.3なので
下記の方法で。


メンテナンス画面を表示させる方法(Apache 1.3対応版)
http://www.shifft.in/blog/development/maintenance-mode/

503.php

<?php
header ('HTTP/1.0 503 Service Temporarily Unavailable');
include(dirname(__FILE__) . '/index.html');
?>


.htaccess

RewriteCond %{REQUEST_URI} !\.css$
RewriteCond %{REQUEST_URI} !\.js$
RewriteCond %{REQUEST_URI} !\.jpg$
RewriteCond %{REQUEST_URI} !\.gif$
RewriteCond %{REQUEST_URI} !\.png$
RewriteCond %{REQUEST_URI} !\.swf$
RewriteCond %{REMOTE_ADDR} !=192.168.0.1 #(管理者のIPアドレス)
RewriteCond %{REQUEST_FILENAME} !503.php
RewriteRule ^.*$ /maintenance/503.php [R,L]

以下は2.2〜

Webサイトのメンテナンス中画面を出す正しい作法と.htaccessの書き方
http://web-tan.forum.impressrd.jp/e/2009/06/16/5880

ErrorDocument 503 /maintenance.html

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{REQUEST_URI} !=/maintenance.html
  RewriteCond %{REMOTE_ADDR} !=192.168.0.4
  RewriteCond %{REMOTE_ADDR} !=192.168.0.5
  RewriteRule ^.*$ - [R=503,L]
</IfModule>

<IfModule mod_headers.c>
  Header set Retry-After "Sun, 14 Jun 2009 6:00:00 GMT"
</IfModule>