PHP redirect – If WordPress blog was moved to new place

The Google indexed old site, so put this PHP script into old folder:

<?php

$foopart = “”;

foreach ( $_GET as $key => $value) {
$foopart .= $key.”=”.$value.”&”;
}

$foopart = substr($foopart, 0, -1);

header(‘Location: http://blogbook.hu/site/?’.$foopart);

?>

Change the domain in th header (‘Location: ..’) part

B logbook : PHP | Javascript | Laravel | CodeIgniter | VueJs | ReactJs | WordPress

Translate »