 <p>I think this would depend on the method you used to do the URL rewriting.</p> <ol> <li><p>Using IIS - Refer to this previous post on how to extract the full URL: <a href="http://stackoverflow.com/questions/15395280/get-current-url-of-the-page-used-url-rewrite">get current url of the page (used URL Rewrite)</a></p></li> <li><p>Using 404 - This is how I've done it in the past and the only way to access the raw URL is to check the querystring. The 404 URL will look something like this:</p> <pre><code>https://website.com/rewrite.asp?404;http://website.com/images/gal/boxes-pic004.asp </code></pre></li> </ol> <p>To get the URL, I use something like this:</p> <pre><code> Function getURL() Dim sTemp sTemp = Request.Querystring ' the next line removes the HTTP status code that IIS sends, in the form "404;" or "403;" or whatever, depending on the captured error sTemp = Right(sTemp, len(sTemp) - 4) ' the next two lines remove both types of server names that IIS includes in the querystring sTemp = replace(sTemp, "http://" &amp; Request.ServerVariables("HTTP_HOST") &amp; ":80/", "") sTemp = replace(sTemp, "http://" &amp; Request.ServerVariables("HTTP_HOST") &amp; "/", "") sTemp = replace(sTemp, "https://" &amp; Request.ServerVariables("HTTP_HOST") &amp; "/", "") sTemp = replace(sTemp, "https://" &amp; Request.ServerVariables("HTTP_HOST") &amp; ":443/", "") ' the next bit of code will force our array to have at least 1 element getURL = sTemp End Function </code></pre> <p>This will get you the full raw URL, you can then extract the part you need by using simple split like:</p> <pre><code> tmpArr = Split(getURL(),"/") strScriptName = tmpArr(UBound(tmpArr)) </code></pre> <p>The strScriptName variable will then return "boxes-pic004.asp".</p> <p>Hope this helps.</p>