![]() |
I followed the instructions and it doesn't appear to work for me. I'm using Apache2 on a Windows host.
I've created the .htaccess file and made sure that the Apache httpd.conf file is set to look for .htaccess files and also includes the 'AllowOverride FileInfo AuthConfig Limit' directive. Template was also included and error.php uploaded. All I get is the usual Windows 404 Error saying page not found. Any ideas? |
* Bump *
|
* Bump @ AlexanderT *
|
Intex, sorry for my late reply. I am not sure why it wouldn't work for you. But the again, I haven't really had experience with either Apache 2 or Windows hosts. Can you use .htaccess files in general (like for protection directories)?
|
can i use this error handler for the forums only, and then a different error handler for my site.
like put a .htaccess in ../ and put your .htaccess in ../forums/ just curious if this is possible or not, or if i should just make the whole site goto the forum error handler. thanks. |
Installed, tested, working as expected.
Thanks for the hack. :) [clicks install] |
Quote:
|
not yet, unfortunately i am in the middle of finals week so i won't be able to sit down and work on my site until next week some time.
|
after installing the hack, all i get is:
Quote:
EDIT: figured it out. in my .htaccess, the link i gave to the error.php file included my URL in front of it ... http://www.mysite.com/forums/error.php ... soon as i changed it to what was shown in the instructions ... /forums/error.php ... it worked like a charm. thanks! |
how do we get this to use whatever skin somebody is using currently?
|
Okay - I was so happy with this hack that I'm going to help improve it. Hopefully, you will find this usefull...
What this does is, for 404 and 500 errors, the server will send you an email notifying you of the error, and providing some information that will assist you in resolving it. open error.php and find: Code:
$error['title'] = "404 File Not Found"; Code:
$error_message = "An attempt to get a file (". $_SERVER['REQUEST_URI'] . ") failed. Please investigate!\r\n"; Code:
$error['title'] = "500 Internal Server Error"; Code:
$error_message = "An attempt to get a file (". $_SERVER['REQUEST_URI'] . ") caused an error. Please investigate!\r\n"; find Code:
eval("print_output(\"".fetch_template('ERROR_SHELL')."\");"); Code:
$error_headers = ""; Save and upload the file and test by going to a non-existing page on your site. You should receive the email right after that. |
couple things with that.
missing the headers to do html mail or something. the error_start and error_footer will never get appended to the body |
You are correct. I could have swore I removed the error_start and error_footer stuff before I posted that. I use that for something else.
Also, I've changed some of the hard coded email addresses to the $vboptions['webmasteremail'] variable. Would it be easier (and allowed) for me to just attach the php file here? It's just the original error page with my stuff added. Whatever is convenient (and doesn't break the rules)..... |
Nice addition, 58sniper!
I'd be only worried to be flooded with e-mails (at least if you have a high traffic site). Although my site is relatively small, for June 2004 I had 3864 404-Document Not-Found-errors, in May even 5048 of these errors. Not because I am sloppy with html programming, but because people (or bots, in majority) were trying to access and spider outdated links. |
The biggest problem I've seen is the PowerPC version of IE. It apparently has poor support for images in CSS. I think I'm going to filter that.
What's the rule about modifying hacks? Do I just post the new file here or do I need to start a new thread and give props? I ask because I'd like to switch all of the IF statements to a switch, and make a few more changes, and I think the new version would be beneficial. |
Great addition. Thanks.
|
Okay - here we go. This is an 'extension' of this hack, which includes:
- Emailing of the webmaster for 404 and 500 errors. - Changed all of the IF ELSE statements to a single SWITCH - Used more vBulletin variables so that no code modification is required to implement this. I've tested this for a couple of days, and haven't seen any problems. Let me know if you spot any. To install, just drop this in your forum folder, overwriting the original (which, of course, you backed up). |
Updated with the following changes:
Subject of error email now indicates type of error. Address of referring page (if it exists) is now a link. This is a straight drop-in replacement for the above. |
This hack was Wrorking With me B4 After We update our Server . it dont work
Can i know what this hack need from me to install any software or anything .. Thankyou |
Quote:
|
hmmm, can someone help me out here? here is my .htaccess and my error.php file. error.php is in the root directory along with the .htaccess file. however if you goto some random page the only thing i get to load up is a blank page. nothing is inserted. even if i goto just error.php it is still blank. but according to the code it should atleast give the very last error on the list. it also never actually goes to error.php ... if you want to goto asfdasdf.php that is still in the URL bar ... shouldn't it redirect to the error.php file?
.htaccess: Code:
ErrorDocument 403 /error.php PHP Code:
|
Quote:
Quote:
Quote:
Well, I can't see what header.inc.php or footer.inc.php include. So I can't really troubleshoot. Did you try just using the originally supplied code? |
this is the original code, i just stripped out the part where it gives the redirect stuff. this way i could have it for any page in my site instead of just the forums.
header and footer basically just open the table and close the table. header also includes the menu. header.inc.php: PHP Code:
PHP Code:
|
actually, i just goofed around with the error.php file and if i place the
PHP Code:
|
Here's an update.
I added info to the email sent to the admin. It now indicates the style number for the user that generated the error. Why? Because one of the things that you'll need to know is what the user was attempting to do that triggered a 404 error. But adding the style, we can further track down missing files or incorrect path problems. I couldn't find a variable that contained the actual style NAME without doing another query. So I just include the style ID number. We can quickly look up which style that corresponds to in the ACP. Just replace the existing file with this one and let me know what you think. |
Quote:
take a look at $datastore['stylecache'], or $stylechoosercache |
If your $error['contact'] message is the same for all errors, you can save some typing by placing it outside of the switch() statement once.
Here's a copy of my file with a few more error codes inserted. |
hi people,
nice hack but it fails to work for me.i have a directory (within my root directory) called "errorpages" i upload error.php and asked my host to allow the "FileInfo" thingy there but i get include errors "Warning: main(./includes/init.php): failed to open stream: No such file or directory " if i add the correct path (eg "../includes/global.php") then vbulletin stop saying that the config file is not there but it is .... what can i do about this ? |
hi,
i've asked my host to configure the "FileInfo" Directory for my httpdocs they replyed they did that (and apache seems to be restarted) however if i go directly to error.php it says "unknown error" (like it should) BUT if you type www.mysite.com/whateverhere => this doesn't exist so a 404 file not found should come up but all i get is white browser window with the text "error.php" printed in it nothing else ?? htaccess file i use Code:
ErrorDocument 400 error.php |
Nice, thank you very much, I was originally going to use this mod but after following the link to this thread, I decided to use this method. To me it was easier and hassle free... again thank you :)
|
Installed it, it works perfectly. Tres cool. Thanks. :D
|
Is anyone getting this hack to work in cpanel?
Got the server configured for AllowOverride FileInfo in httpd.conf. But when I go to test if it works, I just get the browser's default error page. The error log shows an error is there, but it refuses to call the error.php file. :( I put this.... PHP Code:
The error.php in the /forums directory. Created the shell_error file too. But something is wrong, as I can't get the error.php to show it contents. Anyone with a workaround? Chris |
All times are GMT. The time now is 12:32 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|