<p>I recently migrated a website to a new CMS (Umbraco). A lot of the links have changed, but they can be easily corrected by searching for patters in the url, so I would like to write something that will redirect to the correct page if the old one is not found. That part isn't a problem. </p>

<p>How can I obtain the requested URL after the browser is redirected to my custom 404 page. I tried using:</p>

<pre><code>request.ServerVariables("HTTP_REFERER") 'sorry i corrected the typo from system to server.
</code></pre>

<p>But that didn't work.</p>

<p>Any Ideas?</p>

<p>The site is on IIS 6.0. 
We did consider using 301 redirects, but we don't have any way of knowing what pages people have bookmarked and there are a few hundred pages, so no one is keen on spending the time to create the 301's.</p>

Update, you actually want to pick up:
VB.NET:
```
```
Request.QueryString("aspxerrorpath")
```
```
C#:
```
```
Request.QueryString["aspxerrorpath"];
```
```