I would use the Rules module for this. But you can't "rely" on the Rules Scheduler in this case, if you want the redirect to start happening as of 00:00:01 01/01/2016
(sharp).
Redirect old path to new path
Here is the rule you'd need for it (in Rules export format, just use copy/past to import it in your own setup):
{ "rules_redirect_an_alias_at_a_scheduled_time" : {
"LABEL" : "Redirect an alias at a scheduled time",
"PLUGIN" : "reaction rule",
"ACTIVE" : false,
"OWNER" : "rules",
"REQUIRES" : [ "rules" ],
"ON" : { "init" : [] },
"IF" : [
{ "AND" : [
{ "text_matches" : { "text" : [ "site:current-page:url" ], "match" : "the_old_path" } },
{ "data_is" : {
"data" : [ "site:current-date" ],
"op" : "\u003E",
"value" : 1451602800
}
}
]
}
],
"DO" : [
{ "drupal_message" : { "message" : "Please note that the old path (= the_old_path) is no longer in use, you will be redirected automatically to its corresponding path (= the_new_path)" } },
{ "redirect" : { "url" : "the_new_path" } }
]
}
}
A few more tweaks to make it fit your exact scenario:
- change all occurences of
the_old_path
to the path to be used until 00:00:00 01/01/2016
.
- change all occurences of
the_new_path
to the path to be used starting from 00:00:01 01/01/2016
.
Whenever such redirect actually happens, the user will also receive an informational message like so:
Please note that the old path (= /the_old_path
) is no longer in use, you will be redirected automatically to its corresponding path (= /the_new_path
)
If you don't want such message to appear, then just delete the line containing drupal_message
in the exported rule above.
Attention: this exported rule uses UTC times ... if your question is about another timezone, make sure to also tweak the value of 1451602800
to fit your needs.
Redirect new path to old path
If you don't want to have the new path be shown yet BEFORE 00:00:01 01/01/2016
, then just create a similar rule like the previous one, in which you swap the the_old_path
and the_new_path
, and reverse the test on the site:current-date
.