I know you can get the HTTP referer when someone enters your page by clicking a link to it. But is it also possible to determine what page a user is on when they type the address themselves?
According to the standard, the browser MUST NOT send the address of the current page when an address is entered by the user. From the HTTP/1.1 header field documentation:
The Referer field MUST NOT be sent if the Request-URI was obtained from a source that does not have its own URI, such as input from the user keyboard.
Below is my previous answer, which didn't exactly match the question, but I've left it here for history purposes.
The referrer would be empty (or non-existent) if the address is typed directly into the browser, but that's not really something you can rely on (i.e. the referrer could be empty for other reasons).
One notable reason for the referrer to be empty is when a browser switches from secure to non-secure mode.