Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 11th, 2012, 07:56 PM
rageedi rageedi is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2012
Posts: 13 rageedi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 22 m 57 sec
Reputation Power: 0
Designing my own error 404 - page not found

hi Guys,

when i type incorrect url in my browser, i want apache to redirect to my own 404 error page - page not found

this is the line of code in the httpd.conf file i edited

ErrorDocument 404 errors/FileNotFound.html

But it doesnt work

I even created a .htaccess and insert the same line of code, but still its not working,can some please assist

Reply With Quote
  #2  
Old August 11th, 2012, 10:00 PM
requinix's Avatar
requinix requinix is offline
Still alive
Click here for more information.
 
Join Date: Mar 2007
Location: Washington, USA
Posts: 12,680 requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)  Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 5 Months 1 Week 4 Days 1 h 55 m 14 sec
Reputation Power: 8969
Send a message via AIM to requinix Send a message via MSN to requinix Send a message via Yahoo to requinix Send a message via Google Talk to requinix
It's easier in the .htaccess, not the httpd.conf.

In that httpd.conf, or in the definition for your VirtualHost, did you enable AllowOverride? Also, post the definition of your site (either the VirtualHost or the default) and the contents of the .htaccess.

Reply With Quote
  #3  
Old August 13th, 2012, 04:21 AM
rageedi rageedi is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2012
Posts: 13 rageedi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 22 m 57 sec
Reputation Power: 0
Quote:
Originally Posted by requinix
It's easier in the .htaccess, not the httpd.conf.

In that httpd.conf, or in the definition for your VirtualHost, did you enable AllowOverride? Also, post the definition of your site (either the VirtualHost or the default) and the contents of the .htaccess.


Thanks for replying
I am not 100% sure where the .htaccess file should go, i tried several places still not working.

i have just set the allowOverride to ALL - Still not working

This is the content of my .htaccess file
ErrorDocument 404 errors/filenotfound.php


Not sure about your other question regarding virtualhost

Reply With Quote
  #4  
Old August 31st, 2012, 05:43 PM
pyr0commie pyr0commie is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2012
Posts: 12 pyr0commie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 46 m 56 sec
Reputation Power: 0
What error message do you get when you point the browser to a file that does not exist? Does it contain a line like:

'A 404 error was found when trying to use an ErrorDocument do handle the request.'

If this is not there, then the server may not be interpreting your directives. Remember you need to restart the server every time to edit httpd.conf.

If it is there, try changing the directive to
ErrorDocument 404 /errors/filenotfound.php

The first slash tells the server to look from the ServerRoot directory for the file, instead of in the non-existent directory. With your current directive, if you request the page "/foo/bar/index.php", the server will look look for /foo/bar/errors/filenotfound.php which obviously doesn't exist. Changing the ErrorDocument to above will make the server look in "/errors/filenotfound.php" which is what you want.

Hope that helps.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > Designing my own error 404 - page not found

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap