php - Redirect a user to an external site while linking to an . . . PHP: if (filter_var($_GET['site'], FILTER_VALIDATE_URL)) { header('Location: ' $_GET['site']); } With the above example, it will actually take the user to that location, not to: http: example com link php?site=http: www google com To achieve the url being "local" while pulling up a remote site, you'd either have to:
PHP Redirect To Another URL Web Page Script Example How can I use a PHP script to redirect a user from the url they entered to a different web page url? Under PHP you need to use header () to send a raw HTTP header Using headers () method, you can easily transferred to the new page without having to click a link to continue This is also useful for search engines
PHP: URL Functions - Manual How to get the full url url components of the current page: $urlComponents = parse_url(" https: example com article?id=17dgh6ej "); $scheme = $urlComponents['scheme']; * http or https depends on the site *
PHP execute a external url without redirect (background) You should be able to invoke a URL with any of those methods How are you constructing the request? Presumably you're doing something to HTML-encode the URL, which you shouldn't be doing