I am using IIS and PHP. I have a custom 404 page which is a PHP script. On this page, I would like to display the original URL accessed. I am trying the following text plus server variable but it is just showing the site name and HTTP_REFERER is usually blank.
echo 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['HTTP_REFERER'];
What is the correct server variable(s) to use to get the raw URL in PHP/IIS.
This is the appropriate section in my web.config to call the custom 404 page:
<httpErrors>
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="404" prefixLanguageFilePath="" path="/404.php" responseMode="Redirect" />
</httpErrors>