The following code creates a new page:
$p = new Page();
$p->Title = 'Hello';
$p->MenuTitle = $p->Title;
$p->URLSegment = $p->Title;
$p->Content = '';
$p->Status = 'Published';
$p->write();
$p->doRestoreToStage();
$p->publish('Stage', 'Live');
$p->flushCache();
How can I create a redirector page that redirects to / ?
I don't want a normal page, when someone goes to this URL I want them to be redirected to the home page.