10 Replies - 1449 Views - Last Post: 19 February 2012 - 10:05 AM

#1 Syfer  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 190
  • Joined: 08-October 10

404 page not found page

Posted 19 February 2012 - 02:36 AM

Well i'm trying to make a 404 page not found page but i'm running out of idea how to start it and how i can make it work... can anyone help me out about this page?
well i do coded a bit of it but i guess its wrong..

any help would be appreciated.
Is This A Good Question/Topic? 0
  • +

Replies To: 404 page not found page

#2 no2pencil  Icon User is online

  • Toubabo Koomi
  • member icon

Reputation: 5226
  • View blog
  • Posts: 27,000
  • Joined: 10-May 07

Re: 404 page not found page

Posted 19 February 2012 - 02:39 AM

404 pages have nothing to do with php coding. All errors are handled by the webserver.

Are you using Apache or IIS?
Was This Post Helpful? 0
  • +
  • -

#3 Syfer  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 190
  • Joined: 08-October 10

Re: 404 page not found page

Posted 19 February 2012 - 02:54 AM

View Postno2pencil, on 19 February 2012 - 02:39 AM, said:

404 pages have nothing to do with php coding. All errors are handled by the webserver.

Are you using Apache or IIS?



Apache and umm what i want to do is like this
http://www.google.com/adawdawd

because some users bookmark a certain url like
www.freecookies.com/pages.php
and if its renamed or deleted .. it should show a page not found thing..
Was This Post Helpful? 0
  • +
  • -

#4 no2pencil  Icon User is online

  • Toubabo Koomi
  • member icon

Reputation: 5226
  • View blog
  • Posts: 27,000
  • Joined: 10-May 07

Re: 404 page not found page

Posted 19 February 2012 - 03:00 AM

View httpd.conf & look for the line containing : ErrorDocument 404
Was This Post Helpful? 0
  • +
  • -

#5 Syfer  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 190
  • Joined: 08-October 10

Re: 404 page not found page

Posted 19 February 2012 - 07:52 AM

View Postno2pencil, on 19 February 2012 - 03:00 AM, said:

View httpd.conf & look for the line containing : ErrorDocument 404


then whats next?
Was This Post Helpful? 0
  • +
  • -

#6 no2pencil  Icon User is online

  • Toubabo Koomi
  • member icon

Reputation: 5226
  • View blog
  • Posts: 27,000
  • Joined: 10-May 07

Re: 404 page not found page

Posted 19 February 2012 - 07:56 AM

Then you either edit that line to point to your 404 file, or you just edit the file it's currently using.

After you edit the file, you will need to restart the Apache service before the change will take effect.
Was This Post Helpful? 0
  • +
  • -

#7 Atli  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 3715
  • View blog
  • Posts: 5,972
  • Joined: 08-June 10

Re: 404 page not found page

Posted 19 February 2012 - 08:02 AM

View PostSyfer, on 19 February 2012 - 02:52 PM, said:

then whats next?

Change the line so that it points to your new 404 page. Most properly configured Apache servers allow you to put .htaccess files in the root of your website, where you can define this type of stuff. So if you create a page called "Error404.html" in the root of your website, you can just put: ErrorDocument 404 /Error404.html inside a .htaccess file, and now every time a user requests a page that does not exist on that website, your "Error404.html" page will be shown.

Quote

because some users bookmark a certain url like
www.freecookies.com/pages.php
and if its renamed or deleted .. it should show a page not found thing..

Actually, if it is renamed or moved, you should return a 301 error and redirect them to the new page. The 301 error tells the browser that the page has been moved permanently, and if they have bookmarked the old URL that they should update the bookmark. (Not sure if browsers actually honor that last bit.)
Was This Post Helpful? 1
  • +
  • -

#8 Syfer  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 190
  • Joined: 08-October 10

Re: 404 page not found page

Posted 19 February 2012 - 08:31 AM

i already changed it but nothing happened

#ErrorDocument 404 /error.php



p.s
yes i did restart it already.

This post has been edited by Syfer: 19 February 2012 - 08:31 AM

Was This Post Helpful? 0
  • +
  • -

#9 no2pencil  Icon User is online

  • Toubabo Koomi
  • member icon

Reputation: 5226
  • View blog
  • Posts: 27,000
  • Joined: 10-May 07

Re: 404 page not found page

Posted 19 February 2012 - 08:32 AM

You need to remove the comment character (#). save the file & restart.

You should spend a good half an hour to an hour reading over all of the options of the httpd.conf config file. It'll explain in painfully exact detail how to use it, & make your webserver perform how you wish.
Was This Post Helpful? 1
  • +
  • -

#10 Syfer  Icon User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 190
  • Joined: 08-October 10

Re: 404 page not found page

Posted 19 February 2012 - 10:04 AM

thanks a lot
Was This Post Helpful? 0
  • +
  • -

#11 no2pencil  Icon User is online

  • Toubabo Koomi
  • member icon

Reputation: 5226
  • View blog
  • Posts: 27,000
  • Joined: 10-May 07

Re: 404 page not found page

Posted 19 February 2012 - 10:05 AM

Glad to see you got it working.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1