|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
Just a quick question.
I like your article, but something doesnt work i echoed out this line PHP Code:
Instead of printing out something like URL it just gives me my 404 page URL is this because of the .htaccess file??? |
|
#3
|
|||
|
|||
|
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.... |
|
#4
|
|||
|
|||
|
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? |
|
#5
|
|||
|
|||
|
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 |
|
#6
|
|||
|
|||
|
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 .... |
|
#7
|
|||
|
|||
|
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? |
|
#8
|
|||
|
|||
|
have you told apache your using .htaccess files, it is turned off by default, on the windows version of apache.
|
|
#9
|
|||
|
|||
|
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! |
|
#10
|
|||
|
|||
|
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 |
|
#11
|
|||
|
|||
|
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 |
|
#12
|
||||
|
||||
|
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 ![]() |
![]() |
| Viewing: Dev Articles Community Forums > Programming > Programming Tools > Article Discussion:Trap And Get Notified: A Practical Solution To 404 Errors With PHP |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|