0
votes

My IIS rewrites http://example.com/wiki/Main (url before rewrite) to http://example.com/w/index.php?title=Main (url after rewrite).

In index.php, $_SERVER['REQUEST_URI'] returns wiki/Main.

I use Windows 2008 Server, IIS 7, PHP 5.4. The rewriting tool is IIS URL Rewrite Module 2. I'm new to PHP, IIS, and website stuff.

Does REQUEST_URI refer to the url before rewrite or after rewrite?

If REQUEST_URI is the url before rewrite, how can I get the url after rewrite?

1

1 Answers

0
votes

Try parsing the $_GET global array:

$URL = $_SERVER['PHP_SELF'] . '?'; // index.php?
for ($_GET as $key => $value)
{
    $URL .= $key . '=' . $value . '&';
}

Or something like that. Basically, all URL = associations are stored in $_GET.