Finding URL used to access page.
Posted: Wed Jul 03, 2002 2:28 pm
I know It seems like a simple question, but I couldn't find the answer in my searches. What I want is to get the URL the person typed in their browser to get to the page.
The reason I need this, is that I'm using SLL on my server, and I want users who type in "http://www.company.com/login" to be redirected to "https://www.company.com/login" . I know how to tell if https was used or not, but I don't know how to get the http://www.company.com portion. I was thinking:
The reason I need this, is that I'm using SLL on my server, and I want users who type in "http://www.company.com/login" to be redirected to "https://www.company.com/login" . I know how to tell if https was used or not, but I don't know how to get the http://www.company.com portion. I was thinking:
Code: Select all
if(!$HTTPS)
header("Location: https://".$base_path_or_something.$_SERVERї'PHP_SELF']);