I have tried to make a redirect like this: redir.php?page=http://****.com <?php if(is_file($_GET['page'])){$page = $_GET['page'];} else{$page = "DEFAULT.php";} header("Location: ".$page); ?> Code (markup): But I only get: What should I do?
Neither is_file() nor file_exists() is designed to test URLs. They are for checking the local files on the server. If you want to test a URL, you should probably use cURL and look for a response code of 200. Good luck!
See if this works: if($_GET['page']) { if(file_get_contents($page)) { header("Location: ".$page); die(); } else { header("Location: /DEFAULT.php"); die(); } } else { echo "Please specify a url"; //or //header("Location: /DEFAULT.php"); die(); } PHP: