Force https redirect to specific page http

1

I have a site that is in https , but there is a specific page that pulls information from another site that is not in https , which prevents the page in question from correctly loading the content because the browser is blocking loading because the content source page is not in https , otherwise I need to find a way in PHP to force redirection from https to http only on page www.domain.com.br / clipping and keep the other pages of the site as https .

At the moment my code is like this, but it is not working, it always gives an incorrect redirection error.

if ($_SERVER["SERVER_PORT"] != "80") {
   $url = $_SERVER['REQUEST_URI'];
   if ($url == "/clipping"){
      $link = "http://". $_SERVER['HTTP_HOST']. $url;
      header("HTTP/1.1 301 Moved Permanently");
      header("Location: $link");
      exit;
   }
}
    
asked by anonymous 27.07.2017 / 16:31

0 answers