The Artima Developer Community
Sponsored Link

PHP Buzz Forum
Handling 404 Errors with PHP

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Chris Shiflett

Posts: 124
Nickname: shiflett
Registered: Sep, 2004

Chris Shiflett is a PHP security specialist and creative thinker.
Handling 404 Errors with PHP Posted: Oct 30, 2004 12:53 AM
Reply to this message Reply

This post originated from an RSS feed registered with PHP Buzz by Chris Shiflett.
Original Post: Handling 404 Errors with PHP
Feed Title: Chris Shiflett's Blog
Feed URL: http://www.feedburner.com/fb/static/error.html
Feed Description: Author, Consultant, Programmer, Speaker, Trainer
Latest PHP Buzz Posts
Latest PHP Buzz Posts by Chris Shiflett
Latest Posts From Chris Shiflett's Blog

Advertisement

The PHP site does some nice trickery with 404 errors (plus 401 and 403). This is what accomodates short URLs like http://www.php.net/security. Want to do something similar on your own site? I see people asking how to do this all the time, even though the entire site is open source. Just have a look at the error.php script and write something similar for your own site. Use Apache's ErrorDocument directive to have your own error.php script handle any error code you want:

ErrorDocument 401 /error.php
ErrorDocument 403 /error.php
ErrorDocument 404 /error.php

If you have a more flexible error script that people can implement with less hacking, feel free to let me know (or just leave a comment).

Read: Handling 404 Errors with PHP

Topic: DB_Table goes “beta” in new 0.22.0 release Previous Topic   Next Topic Topic: b Tux Jammies 12

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use