inkdrop wrote:So what is the most viable solution? What are other solutions for this?
If you can guarantee that you're going to be running on Apache or a server which provides REQUEST_URI, you can use that (as above).
If you know you're not going to be on HTTPS, you don't need to bother checking that.
If REQUEST_URI is absent, the whole URL can be figured out by a combination of:
SCRIPT_NAME
PATH_INFO
QUERY_STRING
(I think)
Some of the above may be wrong though. REQUEST_URI bundles it all up nicely.
Also if you're doing rewriting, REQUEST_URI appears to give the original one, whereas SCRIPT_NAME gives the modified name.
Mark