Up till now, I've been doing development on a local WAMP server and had my sites hosted on a Dreamhost shared host. Recently, I've wanted to expand what technologies I have access to, so now I'm renting a VPS.
I moved one of my projects over to see how well I've done (I still can't get the mail server working ). I pretty quickly noticed an issue: I use $_SERVER['REDIRECT_URL'] locally to get the current URL without any anchors or query strings on my local server, but noticed that I needed $_SERVER['SCRIPT_URL'] on my Dreamhost server. When I tried either on my new server, nether contains the data I want. I tried to do a var_dump($_SERVER) but there are no variables there that match what I want. I can use $_SERVER['REQUEST_URI'], but it contains the query string as well, so I'd have to separate that out somehow.
Why are the SERVER variables different on each server? Is there something I can do to sync them up? I don't really understand what the difference is and why.
I analyze the path to figure out what file to load (a custom dispatch system). Obviously this means that my code can't simply move between servers. It makes me think I'm doing something wrong given frameworks don't seem to have this issue...