title: In MVC, do I have to implement a custom error filter to redirect the user back from an error page?
body: <p>For usability reasons, I have the requirement that an error page should tell the user something on the lines of </p>
  
  <p><code> Sorry, we could not find this product in our database. You can <a href="http://www.example.com" rel="nofollow noreferrer">go back</a> to the previous page or <a href="http://www.example.com" rel="nofollow noreferrer">search</a> for a different product. 
  </code> </p>
  
  <p>where the <code>go back</code> link is supposed to provide the same functionality as the back button. </p>
  
  <p>I tried implementing it using <code>Request.UrlReferrer</code>, but it was a null in the smoke test. I found <a href="https://stackoverflow.com/a/149162/1983448">an answer here on SO</a> which says that the browser can be set to not send it and </p>
  
  <blockquote>
    <p>Bottom line is that you shouldn't trust it. Just append the url to the GET string and redirect based off that. </p>
  </blockquote>
  
  <p>But as this view is displayed by using the default exception handling filter of MVC, I cannot append this in my code, as it does not send the user to the view in the first place. </p>
  
  <p>Do I have to write my own exception handling filter if I want this functionallity, or is there a simpler way to do it? If I have to write it, what are pitfalls to look out for? It is possible that we will drop the link requirement if this means a substantial increase in the complexity of our code and just let the users click their own back button, but I don't have the experience to make an estimation. </p>