Welcome Guest, Not a member yet? Register   Sign In
[Best practice] Maintenance page
#1

[eluser]Clooner[/eluser]
Before updating a website I always replace the index.php by a maintenance page. After I finished the update I always place the original index.php back again. Because I use mod_rewrite it will always show the maintenance page. I would like to share my maintenance page and maybe make some improvements on this. Maybe someone has suggestions to improve on this. I just center a background image(which contains the message) inside the body to place the message smack in the middle.

Code:
<?php
header("HTTP/1.1 503 Service Temporarily Unavailable");
header("Status: 503 Service Temporarily Unavailable");
header("Retry-After: 86400");
?>
<html>
<head>
  <title>503 - Deze website is tijdelijk niet beschikbaar</title>
<style>
  body { display:block; padding:0px; margin:0px; height:100%; width:100%; display:block; background:url(http://arie.nl/maintenance.png) center no-repeat #3f3f3f; }
</style>
</head>
<body>
</body>
</html>
#2

[eluser]n0xie[/eluser]
Why not do it like us.

In the root have your index.php and your maintenance.php. If you want to do stuff add this line to mod_rewrite at the very top:
Code:
RewriteRule ^(.*)$ maintenance.php [L]

When you're done, just comment it until you need to do another maintenance job...
#3

[eluser]Clooner[/eluser]
[quote author="n0xie" date="1254319089"]Why not do it like us.

In the root have your index.php and your maintenance.php. If you want to do stuff add this line to mod_rewrite at the very top:
Code:
RewriteRule ^(.*)$ maintenance.php [L]

When you're done, just comment it until you need to do another maintenance job...[/quote]

That is also a good option. I use a slightly extended version of my one click deploy system which automatically replaces the index.php files needed and places it back after the update. So I actually don't need to do anything except sit back and relax Big Grin
#4

[eluser]n0xie[/eluser]
[quote author="clooner" date="1254319428"]I use a slightly extended version of my one click deploy system [/quote]
That's pretty nice actually
#5

[eluser]www.sblog.in[/eluser]
Example http://www.webtuts.in/display-site-maint...deigniter/




Theme © iAndrew 2016 - Forum software by © MyBB