Forum Moderators: phranque

Message Too Old, No Replies

I want to change my 404 page to a .php one

but i don't want to break my website

         

HelenDev

2:26 pm on May 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I currently have a 404.html page which I want to make 404.php, or at the very least 404.shtml so I can use include files and bring it into line with the rest of my site.

Is this a good idea or will it break things?

I realise I need to make the 404.php page and upload it to the same directory as 404.html. I can also see some other files in this directory:

.htaccess
404.cgi
404.conf
http-error.cgi

Am I correct in thinking I can just go through these files with a text editor and replace every instance of 404.html with 404.php? Can anyone forsee any problems with doing this? Like I said, I don't want to break the internet ;)

Thanks,

H.

volatilegx

1:36 am on May 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Here's what you want to do:

Edit your .htaccess file so it has this line

ErrorDocument 404 /full/path/404.php

That will specify a document called "404.php" to be the error document for that directory. You should use the full path so that if the 404 document is called for in a subdirectory, it can be found.

HelenDev

9:24 am on May 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks for the reply volatilegx. My site is hosted with an outside party and came with a built in 404 page and notification emails which come to me when a 404 happens.

I have found the existing .htaccess file in my root directory which presently has this in it...


ErrorDocument 404 /404/http-error.cgi
ErrorDocument 500 /404/http-error.cgi

so I guess all the perl stuff in the 404 directory is to do with sending me the error emails. So I am thinking maybe I have to go into these files and change them, as I want to keep on getting the emails?

Helen.

olwen

12:03 pm on May 19, 2004 (gmt 0)

10+ Year Member



Make the php file send you an email. It's pretty easy to do, and you can include your own content

HelenDev

12:08 pm on May 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Make the php file send you an email

Now why didn't I think of this!?

I think I was assuming there was some sort of magic involved - and I wouldn't want to mess with the occult ;)