Wrox Programmer Forums
Pro PHP Advanced PHP coding discussions. Beginning-level questions will be redirected to the Beginning PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old December 19th, 2004, 10:06 AM
Authorized User
Join Date: Nov 2004
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default 404 error

i dont know if i'm in the right catogary for PHP to ask this type of question, i wanna code for PHP to create a 404 error on my page.

ex: if the viewer enterted mysite.com/something.html i wanna show a 404 wanna enter a 404 error on my site, not just for one url but everytime he tried to enter a mistaken address.

Plz can u help me
[God bless the week and strong]

Old December 19th, 2004, 11:36 AM
Authorized User
Join Date: Jul 2004
Posts: 79
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to rajuru Send a message via Yahoo to rajuru

You may go to PHP Begginers Room
anyway to do such follow the instruction:
1. Design a custom error page
2. Save it as error.php or you like best and upload to your public_html directory
3. Add the following line to your .htaccess file

     ErrorDocument 404 /error.php

4. From Now every request for wrong page will redirected to this page

Best Regard:
Md. Zakir Hossain (Raju)

Similar Threads
Thread Thread Starter Forum Replies Last Post
catch 404 error danielnixon ASP.NET 2.0 Basics 1 May 1st, 2008 06:57 PM
Error 404 SeniorNSU BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 1 August 30th, 2006 11:09 AM
404 error DARSIN .NET Framework 2.0 1 March 24th, 2005 06:04 AM
404 - File not found error geeta Classic ASP Professional 1 October 23rd, 2004 09:25 AM
Error 404 jackps Dreamweaver (all versions) 2 January 15th, 2004 09:29 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.