Custom Errors

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Elite
    Senior Member
    • Apr 2004
    • 168

    Custom Errors

    I have set up custom 404s using .htaccess:

    Code:
    ErrorDocument 404 [url]http://mydomain.com/errors/404.php[/url]
    this works fine - however the URL displayed in the address field is http://mydomain.com/errors/404.php not the requested URL

    Is there anyway to display the requested URL in the address field?

    Cheers

    Nick
  • Frank Hagan
    Senior Member
    • Mar 2004
    • 724

    #2
    Not sure you can after you've redirected to the error page.

    There is a variable you can use for the "referring page" that can be part of your custom error page, so you could say something like

    [referring URL] is not found on our server!

    Comment

    • ndns
      Junior Member
      • Apr 2004
      • 7

      #3
      In order to get the requested page/file URL to show in the address bar, you need to omit the domain name. Use this in your .htaccess file:
      Code:
      ErrorDocument 404 /errors/404.php

      Comment

      • Elite
        Senior Member
        • Apr 2004
        • 168

        #4
        Thanks for the replys

        ndns - Just what I was looking for

        cheers

        Nick

        Comment

        Working...