Closing a website (mod_redirect)
| From: | Alex Chamberlain | Date: | Tue, 26 Aug 2008 16:32:47 +0000 |
| Subject: | Closing a website (mod_redirect) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-278734@lists.php.net to get a copy of this message | ||
Hi,
From time to time, I will need to update my website. During this time, I
would like to forward all traffic to a ‘closed for site maintenance’ page.
This page will have an image. I’ve had a go using mod_redirect:
RewriteEngine on
RewriteRule ^.*/splash.png$ http://localhost/kayaknames/closed/closed.png
[R]
RewriteCond %{REQUESTURI} !^.*/closed/closed.png.*$
RewriteRule ^.*$ http://localhost/kayaknames/closed/closed.htm
[R,L]
Closed.htm:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html style="">
<head>
<title>Kayak Names</title>
</head>
<body style="text-align: center; vertical-align: middle;">
<div style="margin: auto; height: 500px; width: 900px;">
<img src="splash.png" alt="Kayak Names" />
</div>
</body>
</html>
It works, but the image is not shown as it redirects to closed.png
(correctly), but then redirects again to closed.htm - hence no image.
Wondering if anybody had any ideas where I am going wrong??
Thanks,
Alex
No virus found in this outgoing message. Scanned by AVG Free 8.0
Checked by AVG - http://www.avg.com
Version: 8.0.138 / Virus Database: 270.6.9/1635 - Release Date: 26/08/2008
07:29