The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Custom error-handler based on vBulletin templates Details »» | |||||||||||||||||||||||||||
Custom error-handler based on vBulletin templates
Developer Last Online: Jul 2021
What this hack does?
--------------------------- UPDATE: Improved instruction.txt, fixed for those who use external style sheets This hack adds a custom error-handler to your site using the vBulletin template engine to display the appropriate errors (e.g. 404 File not Found, 403 Forbidden, etc). Demo ------- Go to my site and enter some non-existing url. E.g. Random 404 Error. Or try to access my /cgi-bin path to receive a 403 error. What to do? ---------------- queries to run: 0 templates changed: 0 templates added: 1 (ERROR_SHELL) files changed: 1 (.htaccess) files added: 1 (error.php) Time needed to install ---------------------------- < 5 mins Show Your Support
|
Comments |
#62
|
|||
|
|||
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 ErrorDocument 404 /error.php ErrorDocument 401 /error.php ErrorDocument 500 /error.php ErrorDocument 503 /error.php PHP Code:
|
#63
|
|||
|
|||
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? |
#64
|
|||
|
|||
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:
|
#65
|
|||
|
|||
actually, i just goofed around with the error.php file and if i place the
PHP Code:
|
#66
|
|||
|
|||
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. |
#67
|
||||
|
||||
Quote:
take a look at $datastore['stylecache'], or $stylechoosercache |
#68
|
||||
|
||||
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. |
#69
|
|||
|
|||
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 ? |
#70
|
|||
|
|||
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 ErrorDocument 401 error.php ErrorDocument 403 error.php ErrorDocument 404 error.php ErrorDocument 500 error.php |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|