« 動的ページを静的ページに見せかける | トップ | 藤井さんが、トラックバックをマスター! »

2004年09月28日

一時的にサイト全体にアクセスできないようにする  このエントリをはてなブックマークに登録 

昨日書いた、動的ページを静的ページに見せかける、というのと同様の、mod_rewriteを使ったTIPSです。
.htaccessに以下のように書くと、.htaccessを置いたディレクトリ以下には、ブラウザからアクセスできなくなり、常に、temp.htmlというファイルの内容が表示されることになります。temp.htmlには、「メンテナンス中です」などと書いておけば良いでしょう。

RewriteEngine on
RewriteBase /
RewriteRule .* temp.html

サイトのファイルを丸ごと上げなおす、なんていうときには有効だと思います。

上記では、temp.htmlとなっていますが、この部分は適当に変更可能です。

Apacheサーバを使用していて、かつ、「mod_rewrite」の使用が許可されている環境でのみ有効な方法です。

投稿者 田中@グリニッジ : 2004年09月28日 20:29

トラックバック

このエントリーのトラックバックURL:
http://blog.tanaka-cs.com/mt/mt-tb.cgi/24

コメント

投稿者 John Moore : 2005年10月23日 11:52

Hey! I liked your site very much! Hacking OpenSUSE: http://news.linux.com/news/05/10/10/0213220.shtml?tid=96 , An investment in knowledge pays the best interest , It's impossible to experience one's death

投稿者 Carlos Blanton : 2005年11月16日 00:11

Good work. I like your site. which differ from the prejudices: http://www.ipl.org/div/light , when Pair Roll Round Expect that get all the publicity , Collective is feature of Profound Game while they only recover

コメントしてください




保存しますか?


楽天トラベル 夏の旅行