For example i have this url
mysite.com/page1-bla-bla.html
that have time specific content will be available for specific time period then after that the url should redirect to home page.
i think this will the solution for the problem i found today when i checked my google webmaster account today and found that i have many crawl errors due to 500 internal server error from pages that their content has expired as the content in this kind of pages is time limited available for specific time.
i have no idea how to do this may be htaccess is the solution or what?
looking for your ideas
Usually, it's being done programmatically in your PHP script, this would let you have more control over the data and logic. But if you want to do something like this in your .htaccess, check out this article on time-related usage of mod_rewrite: http://www.askapache.com/htaccess/time_hour-rewritecond-time.html.
Take a look at this: link
if you want a redirect after a period of time.
Assuming I understood the question, you could add the following to the <head>
of the HTML:
<meta http-equiv="refresh" content="600;URL=http:/mysite.com/" />
This will redirect the browser to the address http:/mysite.com/
after 600
seconds (10 mins).
Edit:
$hours = intval(date('H'));
if ($hours < 7) {
header('Location: http:/mysite.com/');
die();
}