Set expiration for you index page

If you want to set the expiration to your site ¬† means after some date or year your site shows custom error on the page then you can add following code in index page below the “<?php” code¬† and set the date as per your request.
============================================
$exp_date = "2010-04-31";
$todays_date = date("Y-m-d");
$today = strtotime($todays_date);
$expiration_date = strtotime($exp_date);
if ($expiration_date <= $today)
{
echo '<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html>
<head>
<title>Expired...</title>
</head>
<body>
<h1>What you search</h1>
<p>Now Site is Expired </p>
<hr>
<address>I have set the expiration to my site ,we need to increase expiration date in index page</address>
</body>
</html>
';
exit;
}

============================================

Related posts

12 Thoughts to “Set expiration for you index page”

  1. You certainly deserve a round of applause for your post and more specifically, your blog in general. Very high quality material

  2. Very informative post. Thanks for taking the time to share your view with us.

  3. You certainly have some agreeable opinions and views. Your blog provides a fresh look at the subject.

  4. I find myself coming to your blog more and more often to the point where my visits are almost daily now!

  5. Very Interesting Information! Thank You For Thi Post!

  6. You certainly deserve a round of applause for your post and more specifically, your blog in general. Very high quality material

  7. I love your blog.. very nice colors & theme. Did you create this website yourself or did you hire someone to do it for you? Plz reply as I’m looking to design my own blog and would like to know where u got this from. many thanks

    1. Thanks for the comment. I have created this blog myself and you can download the this theme from http://www.web2feel.com/ with the name “Evander 1.0.0” but be sure that do not create copy of my site.

  8. Amie Gammage

    I enjoy, result in I found just what I used to be having a look for. You’ve ended my four day lengthy hunt! God Bless you man. Have a great day. Bye

  9. Do you guys have a facebook fan webpage? I searched for one on facebook or myspace but couldnt find one, Id love to become a fan!

Leave a Comment