[wp-hackers] REQUEST_URI on IIS isn't SCRIPT_NAME
computerguru at neosmart.net
Mon Oct 23 08:18:40 GMT 2006
> Tried dumping $_SERVER to see if there's anything useful there? MSDN
> list a couple of possible variables: URL, UNENCODED_URL,
No, none of them work... They all return the actual script's path instead of
the virtual directory or alias.
I found something that'll suffice: $_SERVER['PATH_TRANSLATED'];
It's nonsense, it takes apache's REQUESTED_URI and prepends the document
root, such that for a page titled "About" in WP it would show
No point to it as far as I can see, but by
$REQUESTE_URI = str_replace("\", "/", str_replace($_SERVER["DOCUMENT_ROOT"],
Seems to work.
Hackaday job... but it'll do the trick.. I bet this changes from IIS to IIS,
it just doesn't seem right. But it'll do well enough for my implementation.
More information about the wp-hackers