design error page so URL stays same

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jonathan
    Senior Member
    • Mar 2004
    • 1229

    #1

    design error page so URL stays same

    hey guys; not sure if title is right for this

    I want to make an error page, using .HTACCESS, so like...
    User goes to 'page1.php' which works; from there, goes to link 'page2.php'.

    But 'page2.php' no exists; how do I make it so that
    it shows the error page, but the url stays 'page2.php'

    This way they can type the page URL in,
    so I know exactly what is wrong.

    Also is there a way to use PHP to see
    what URL referred it, and automatically
    fill in an hidden form so I can see what page
    linked to this error page??

    How would I do this??
    Is it possible?

    Regards,
    "How can someone be so distracted yet so focused?"
    - C
  • james
    Senior Member
    • Mar 2004
    • 183

    #2
    Jon,

    To get the error page not to redirect, use
    Code:
    ErrorDocument 404 404.php
    If you use a complete url, instead of a relative one, then the browser address will change.

    James

    Comment

    • Jonathan
      Senior Member
      • Mar 2004
      • 1229

      #3
      didn't we just discuss that on MSN??
      I should've edited the 1st post
      "How can someone be so distracted yet so focused?"
      - C

      Comment

      • james
        Senior Member
        • Mar 2004
        • 183

        #4
        Yes but this will hopefully help others too.

        Comment

        Working...