<?php
$url = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REDIRECT_URL'];
header('HTTP/1.1 301 Moved Permanently');
header('Location: '.$url);
?>