You are on page 1of 1

if(substr($_SERVER['REQUEST_URI'], -9) === 'index.

php')
{
$url =$protocol.''.$_SERVER['HTTP_HOST'].substr($_SERVER['REQUEST_URI'], 0,-9);
header("Location:$url");

}
else if(substr($_SERVER['REQUEST_URI'], -8) !== 'shop.php')
{
$url =$protocol.''.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
// $domain = $_SERVER['HTTP_HOST'];
// $url = "http://" . $domain . $_SERVER['REQUEST_URI'];
$url= substr($url, 0, strpos($url, "?"));
header("Location:$url");
}
else
{
$url =$protocol.''.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
// $domain = $_SERVER['HTTP_HOST'];
// $url = "http://" . $domain . $_SERVER['REQUEST_URI'];
// $url= substr($url, 0, strpos($url, "?"));
// header("Location:$url");

You might also like