Using PHP and a custom 404 page to forward site visitors to a new server:
<html lang="en">
<head>
<title>All sites have been forwarded</title>
</head>
<body>
The new address for the page you requested is:<br>
<a href="http://new.server.address<? echo $REQUEST_URI; ?>">
http://new.server.address<? echo $REQUEST_URI; ?></a><br>
Please update your bookmarks.
</body>
</html>
I couldn’t find a good example of this anywhere else on line, so here it is. It’s stupidly simple in retrospect but it took me most of the afternoon to figure it out. I hope someone out there finds it useful…
2 responses to “Handy PHP script”