Going back to previous internal page after 404

Steps to get this bug:

  1. You click on a link which redirects to a section where you don’t have access to.
  2. If it says error 404, click on the < button to go to the previous page
  3. It just redirects to the 404 page instead of the previous page.