I've looked at other answers and I see that
$_SERVER['REQUEST_URI'] is usually recommended and is the accepted answer for getting the current page URI along with
I looked at the WP source code and it's widely used there too.
But I found some controversy about it not working on IIS. Perhaps it was only an issue in the past? I even tried to install IIS in my PC to check it out but I can't configure it and it seems like an overkill just to confirm this.
It seems like it's the only SERVER variable that includes the information I want:
the highlighted example part is added via NextGEN Gallery 2 and is only accessible through the
$_SERVER['REQUEST_URI'], nothing else. Previously it was accessible using get_query_var, not anymore.
$_SERVER['REQUEST_URI'] is not set, faking it through setting it manually and creating it based on
QUERY_STRING brings inequivalent results.
So is it safe to rely on
$_SERVER['REQUEST_URI'] being always available for use on WP installs? I assume it is since the WP core code uses it, but I had to ask.