A Home of knowledge

Sunday, 2 September 2012

Make a maintenance page using PHP.

Easy to make a maintenance page using PHP.Just open a note pad and past the code.
<?php
header(“HTTP/1.1 503 Service Temporarily Unavailable”);
header(“Status: 503 Service Temporarily Unavailable”);
header(“Retry-After: 3600″);
?>
<html>
<head>
<title>Site upgrade in progress</title>
<meta name=”robots” content=”none” />
</head>
<body>
<h1>Maintenance Mode</h1>
<p><a title=”Your site” href=”your-site-url”>Your Site name</a> is currently undergoing scheduled maintenance.<br />
Please try back <strong>in 60 minutes</strong>.</p>
<p>Sorry for the inconvenience.</p>
</body>
</html>
 Now save this file to “maintenance.php”
maintenance page is OK Now redirect your visitor to this page.folow the instruction.
uplode this file to this directory http://yoursitename.com/maintenance.php
Download this file from your directory .htaccess file Open this file to text editor and past the code in the begin the page.
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REQUEST_URI} !/maintenance.php$
RewriteCond %{REMOTE_HOST} !^127\.0\.0\.1
RewriteRule $ /maintenance.php [R=302,L]
Edit 127\.0\.0\.1 code with your IP number.Now re-upload .htaccess file.
You can see your site well but you visitor only see the maintenance page.
 

 

No comments: