Mobile app version of vmapp.org
Login or Join
Annie201

: Redirect at exact moment in time My company is going to do a press release next month. At that exact moment in time, we need a new domain to go to this site at the time of the press release

@Annie201

Posted in: #Lamp #Linux #Php

My company is going to do a press release next month. At that exact moment in time, we need a new domain to go to this site at the time of the press release at 3 PM.

Since the domain name already exists, my plan was to have an index.html and index.php in the root directory of the web server. index.html would redirect to our current website and index.php would have the page for our new site (under the separate domain name). My plan was at 2:59 PM I would rename the index.html file so that index.php would be the only index file on the server, and requests going to example.com wouldn't redirect anymore but instead stay on the new site.

Is there a more efficient way of ensuring this? This is an Apache 2 server running PHP 5.3 and MySQL 5.5

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Annie201

2 Comments

Sorted by latest first Latest Oldest Best

 

@Dunderdale272

You could just include a rule in your index.php to check the current time against the time you want to launch. So if you wanted to launch on 2015-12-01 at 15:00UTC, something like this should work:

<?php if(time() < '1448982000'){
header("Location: www.example.com/ ,TRUE,301);
exit;
}?>


Drop that into the very top of index.php and adjust accordingly.

10% popularity Vote Up Vote Down


 

@Gonzalez347

It's really risky solution. Some browser (or ISPs) can cache index.html. After refreshing page, some users can find some troubles there.

I believe much better solution will be using only one .php file as a routing file, which will detect time and do different things on these time frames.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme