Welcome Guest, Not a member yet? Register   Sign In
getting $host from $_SERVER
#2

(This post was last modified: 02-26-2023, 11:04 AM by Gary.)

Question: If HTTPS is forced, then why bother about a fallback... or isset($_SERVER['HTTPS']?

The automatic redirection can be easily done in Apache, before it even gets to the CI code... this would likely be the easiest and "cleanest" solution in terms of the code and side-stepping the need for band-aids over all the possible holes (?).

The other question I would ask is whether $_SERVER[' HTTP_HOST'] is necessary either (particularly on a small Raspberry PI)... and then mostly only because- be it correct or not- many folk don't trust very much of what comes out of $_SERVER.
Reply


Messages In This Thread
getting $host from $_SERVER - by badger - 02-26-2023, 08:25 AM
RE: getting $host from $_SERVER - by Gary - 02-26-2023, 11:02 AM
RE: getting $host from $_SERVER - by badger - 02-26-2023, 11:20 AM
RE: getting $host from $_SERVER - by kenjis - 02-26-2023, 07:17 PM
RE: getting $host from $_SERVER - by badger - 02-27-2023, 02:14 AM



Theme © iAndrew 2016 - Forum software by © MyBB