-2

Hello, I want to make a panel so that we can change the redirection link of the page,

in the header(); . I want that the header($result); redirect to "amazon.com" the official site (for example) and not http://localhost/amazon.com

($result which is amazon.com obviously)  

Is it possible ?

I have already tried with javascript :

<script type="text/javascript">
window.location.href = '<?php echo $result; ?>';
</script>

But it also returns me

"http://localhost/amazon.com"

And here is the php code

  header("Location: .$result");
  exit;

Thanks in advance for your help

1 Answers1

0

Your URL is missing the scheme (https:// or http://) or the marker to indicate that it is a scheme-relative URL (//).

amazon.com is therefore treated as a relative path and not as a hostname.

You need https://amazon.com

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335