Programming Tools
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingProgramming Tools

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old August 13th, 2002, 09:43 PM
mytch mytch is offline
Dev Articles Novice (500 - 999 posts)
 
Join Date: Apr 2002
Location: Sydney, Australia
Posts: 589 mytch User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Article Discussion:Trap And Get Notified: A Practical Solution To 404 Errors With PHP

If you have any questions or comments about this article then please post them here.

This forum post relates to this article

Reply With Quote
  #2  
Old August 15th, 2002, 12:40 AM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Just a quick question.

I like your article, but something doesnt work

i echoed out this line

PHP Code:
 $where "http://" $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; 

echo 
$where


Instead of printing out something like

URL

it just gives me my 404 page

URL

is this because of the .htaccess file???

Reply With Quote
  #3  
Old August 15th, 2002, 03:37 AM
fakker fakker is offline
The calm b4 the storm
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Manchester, UK
Posts: 404 fakker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via Yahoo to fakker
not sure!!

I got that same ting when I was testing my code, try using

$where = "http://$HTTP_HOST$REQUEST_URI";

I dont know if it is any different to the code in the article, but that is that I have used....
__________________
Matt 'Fakker' Facer

mattfacer.com

Reply With Quote
  #4  
Old August 20th, 2002, 03:31 AM
Hermit Hermit is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Location: Riga, Latvia
Posts: 3 Hermit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Doesn't work in IE?

Good article...the only problem is when I try to type invalid URL in Internet Explorer 6.0, it's still redirects me to standart "The page cannon be displayed" page.

But in Mozilla I'm redirected the way it should be (to my error404.php page)


So if user has IE this trick doesn't work?

Reply With Quote
  #5  
Old August 20th, 2002, 04:08 AM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
that doesnt make sense, since the its done server side, and not client side, there fore it wont matter what browsers your using, because it works or me

try

URL

Reply With Quote
  #6  
Old August 20th, 2002, 04:57 AM
Hermit Hermit is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Location: Riga, Latvia
Posts: 3 Hermit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Same thing....

If I open your link in Mozilla I see your page (error404.php), but if I open it using IE 6.0 -- I get standart "The page cannot be displayed" with "Cannot find server" title...

I'm confused ....

Reply With Quote
  #7  
Old August 20th, 2002, 05:11 AM
Hermit Hermit is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Location: Riga, Latvia
Posts: 3 Hermit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Ok, sorry for the last post, it just should be

"www.case-extreme.com/this-file-doesnt-exist" for IE, not just "www.case-extreme/this-file-doesnt-exist"


I see your error404.php page now.

But still I have this problem with my Apache and IE. Could it be because my Apache is running under Windows?

Reply With Quote
  #8  
Old August 20th, 2002, 06:47 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
have you told apache your using .htaccess files, it is turned off by default, on the windows version of apache.

Reply With Quote
  #9  
Old December 27th, 2002, 06:10 PM
theatlas theatlas is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 1 theatlas User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Many Errors in Script

There are some errors in the script / files:

1. Use: $where = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];

2. Fuond versus found

3. <p> is used when </p> should be used.


Thanks for the education and ideas, though!

Reply With Quote
  #10  
Old January 17th, 2003, 10:18 AM
nosta nosta is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Posts: 9 nosta User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
If the page doesn't display (but you got the warning emails for example) this should probably the reason ... :

Your custom message file must be larger than 512 bytes in order to bypass the standard IE5.0 error message.

Greetz, nosta

Reply With Quote
  #11  
Old January 26th, 2003, 03:21 PM
phish phish is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2003
Posts: 1 phish User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thumbs up Nice article

Cool article. I've used a custom 404 pages in the past but never using PHP to get email notications.

The only thing I do not like is the ton of messages I get when someone runs worm attack on my site looking for cmd.exe or shell.exe.

So... Can someone tell me how to not have the email notification if the file that was not found meets certain criteria, ie the filename or directory?

Thanks

Doug

Wash Uffizzi and Drive me to Firenze
www.completewebs.com

Reply With Quote
  #12  
Old January 30th, 2003, 03:42 PM
nicat23's Avatar
nicat23 nicat23 is offline
Addicted to Chaos..
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jan 2003
Location: Ft. Worth, TX
Posts: 653 nicat23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 47 m 52 sec
Reputation Power: 0
Send a message via AIM to nicat23 Send a message via Yahoo to nicat23
Everyone.. To get this to work on my server I had to put this into the httpd.conf under the main directory setting

Code:
<DIRECTORY "/whatever-the-path-to-your-www-root">
ie: <directory "/var/apache/htdocs">

    Options Indexes FollowSymLinks MultiViews
    AllowOverride FileInfo
    Order allow, deny
    Allow from all
</directory>


I had to modify it to be that, because the override for redirecting and ErrorDocument is FileInfo per the apache manual

http://httpd.apache.org/docs/mod/co...l#errordocument

If you have allowoverride none that would explain why it is not working entirely... try that, hope it helps

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingProgramming Tools > Article Discussion:Trap And Get Notified: A Practical Solution To 404 Errors With PHP


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 | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway