I have a website (let's call it www.mywebsite.com) that allows users to enter a URL that other users on my website can be redirected to. If a user types in a full URL like so https://www.google.com then all is well because my header() function will redirect to exactly that.
However when a user enters in www.google.com or even google.com then the header() function will attempt to redirect to this https://www.mywebsite.com/www.google.com.
Remember, I can't fully format the user's URL myself because the program doesn't know whether the website is https:// or http:// and if you get this wrong the user can end up at a non existent page.
What I need is a method of telling PHP to just go to the URL specified without relativity to my website almost like the a user had typed it in the URL bar themselves.
Any ideas?