<p>I moved a <a href="http://en.wikipedia.org/wiki/WordPress" rel="noreferrer">WordPress</a> installation to a new folder on a Windows/<a href="http://en.wikipedia.org/wiki/Internet_Information_Services" rel="noreferrer">IIS</a> server. I'm setting up 301 redirects in PHP, but it doesn't seem to be working. My post URLs have the following format:</p>

<pre class="lang-none prettyprint-override"><code>http:://www.example.com/OLD_FOLDER/index.php/post-title/
</code></pre>

<p>I can't figure out how to grab the <code>/post-title/</code> part of the URL.</p>

<p><code>$_SERVER["REQUEST_URI"]</code> - which everyone seems to recommend - is returning an empty string. <code>$_SERVER["PHP_SELF"]</code> is just returning <code>index.php</code>. Why is this, and how can I fix it?</p>

```
$_SERVER['REQUEST_URI']
```
doesn't work on IIS, but I did find this:
http://neosmart.net/blog/2006/100-apache-compliant-request_uri-for-iis-and-windows/
which sounds promising.