PHP date/time based redirect (embargo)

Sometimes you want to put a (new) site live at a specific time, or redirect users to a different page after a specific date or time (e.g. on an event site, after the event has started).

You can do this using .htaccess files, but a quick and easy way is to create a file, e.g. auto-redirect.php. Then include this file at the top of your existing PHP script, for example your WordPress theme’s functions.php or just in index.php.

Include the script:
include ‘auto-redirect.php’;

Fix Wifi after suspend (Ubuntu 16.04 / ‘Device not ready’)
Permanent & temporary Apache .htaccess redirect (301 & 302)