How would I go about creating a 404 page that actually knows what url they tried to go to?
For example, if I go to http://www.samplesite.com/thispagedoesnotexist.html, i will get a 404 page. I want this 404 page to display the above url as text in the browser.
window.location.href to retrieve the browser's current URL as long as you aren't redirecting to a static 404 page url. (e.g. http://www.samplesite.com/404.html)
You can also accomplish this on the backend by looking at the server variables through ASP.net, PHP, et al.
<!-- php code to get the requested url. --> <? $_SERVER['REQUEST_URI'] ?>
This code will simply right out the requested url into your html.