SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2007
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP Question Regarding "Page Not Found"?

    Hi Everyone,

    I have a question regarding when making a "page not found" page on your website.

    How can I make sure a page doesn't carry the variable that's being got from page to page? Meaning if a user/visitor types something into my URL, how do I make sure that word or key-phrase they type-in doesn't appear on the page itself and make sure they get presented with a "Page Not Found"?

    For example,
    If I type in "whatever" at the end of the URL I get presented with a "Page not found" page and the key-phrase "whatever" dosen't appear on edmunds.com website. How would I make this happen with my website? What do I need to do?

    http://www.edmunds.com/ford/whatever/

    Thanks everyone

  2. #2
    SitePoint Evangelist captainccs's Avatar
    Join Date
    Mar 2004
    Location
    Caracas, Venezuela
    Posts
    516
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by scm22ri View Post
    How can I make sure a page doesn't carry the variable that's being got from page to page? Meaning if a user/visitor types something into my URL, how do I make sure that word or key-phrase they type-in doesn't appear on the page itself and make sure they get presented with a "Page Not Found"?
    You don't need to. Either Apache finds the page to serve or it doesn't. If it doesn't, you tell it you have custom error pages in .htaccess with, for example:
    Code:
    ErrorDocument 403 /errors/error403.php
    ErrorDocument 404 /errors/error404.php
    ErrorDocument 406 /errors/error406.php
    ErrorDocument 500 /errors/error500.html
    Denny Schlesinger
    web services


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •