Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Add-ons

Reply
 
Thread Tools
Custom HTTP Error Pages Details »»
Custom HTTP Error Pages
Version: 1.00, by JamesAB JamesAB is offline
Developer Last Online: Sep 2023 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 3.8.0 Rating:
Released: 03-05-2009 Last Update: 03-05-2009 Installs: 99
Supported Uses Plugins
Re-useable Code Additional Files Translations  

About this hack:
This hack allows you to use vBulletin template driven pages for 400, 401, 403, 404 and 500 webserver error pages that will perfectly match your own forum's design. Five custom pages are added to your forum by this hack. You can then instruct your webserver to use these pages for it's error pages.

Features:
  • Error pages will still work even if your forum is turned off in the AdminCP.
  • Admin CP option to automatically redirect to your forum's main page after the error page is shown for 5 seconds.
  • Admin CP option to show or hide notices on error pages.

Installation information on hack:
  • Files to upload: 5
  • New templates added: 5
  • Time to install: 10 minutes.
You can test that the pages are working correctly by visiting:
<URL OF YOUR FORUM HOME>/400_forum.php
<URL OF YOUR FORUM HOME>/401_forum.php
<URL OF YOUR FORUM HOME>/403_forum.php
<URL OF YOUR FORUM HOME>/404_forum.php
<URL OF YOUR FORUM HOME>/500_forum.php
Next you will need to edit your webserver's configuration file or add lines into an .htaccess file.
.................................................. ..........
If your forum directory is the same as your website's document root, add these lines:
Code:
ErrorDocument 400 /400_forum.php
ErrorDocument 401 /401_forum.php
ErrorDocument 403 /403_forum.php
ErrorDocument 404 /404_forum.php
ErrorDocument 500 /500_forum.php
.................................................. ..........
If your forum is located in a directory within your website's document root, you'll need to replace <forum_directory> with the directory of your forum in these lines:
Code:
ErrorDocument 400 /<forum_directory>/400_forum.php
ErrorDocument 401 /<forum_directory>/401_forum.php
ErrorDocument 403 /<forum_directory>/403_forum.php
ErrorDocument 404 /<forum_directory>/404_forum.php
ErrorDocument 500 /<forum_directory>/500_forum.php
.................................................. ..........
  • You can easily customize the templates for each indivual error page.
    The templates can be found grouped together under HTTP Error Templates.
  • For the purpose of this hack, I used very generic error messages.
    You can easily edit any of the phrases to best suit your site.
    Each page uses three different vBulletin phrases.
    1. The error name in the navbit. (for example... jab_404_error_navbit )
    2. The title of the error table. (for example... jab_404_error_title )
    3. The message shown for the error. (for example... jab_404_error_message )

Updates:

Version 1.0 (03/05/09):
  • Release of this hack for vBulletin version 3.8.0

MAKE SURE YOU CLICK INSTALL!

Screenshots:
These show the five error pages in vBulletin's default style.
Your pages will use your own forum's style and look just like your other pages.
In the "400 Bad Request" screen shot, I indicated the three phrases that can be edited.

Download Now

File Type: zip custom_http_error_pages.zip (6.4 KB, 549 views)

Screenshots

File Type: jpg http_error_400.jpg (104.9 KB, 0 views)
File Type: jpg http_error_401.jpg (74.0 KB, 0 views)
File Type: jpg http_error_403.jpg (68.0 KB, 0 views)
File Type: jpg http_error_404.jpg (68.1 KB, 0 views)
File Type: jpg http_error_500.jpg (66.6 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 03-28-2009, 09:56 AM
PossumX's Avatar
PossumX PossumX is offline
 
Join Date: Oct 2006
Location: NE USA
Posts: 141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice addition. One note is that it only works properly if the Store CSS Stylesheets as Files? option is set to No. When yes, the style is ignored, and it looks horrible. Would be great if you could integrate the usage of CSS Stylesheet files as well.
Reply With Quote
  #13  
Old 03-28-2009, 12:28 PM
JamesAB JamesAB is offline
 
Join Date: Dec 2003
Posts: 125
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by PossumX View Post
Nice addition. One note is that it only works properly if the Store CSS Stylesheets as Files? option is set to No. When yes, the style is ignored, and it looks horrible. Would be great if you could integrate the usage of CSS Stylesheet files as well.
On my forum, I have always had Store CSS Stylesheets as Files? set to Yes and it is working properly.
I'm not sure I completely understand the problem and why you are having trouble.

Thanks,
James
Reply With Quote
  #14  
Old 03-29-2009, 06:53 PM
PossumX's Avatar
PossumX PossumX is offline
 
Join Date: Oct 2006
Location: NE USA
Posts: 141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Must conflict with something else. >>uninstalled<<
Reply With Quote
  #15  
Old 03-29-2009, 07:43 PM
RedDevil's Avatar
RedDevil RedDevil is offline
 
Join Date: Mar 2008
Location: Cumbria, UK
Posts: 310
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed didnt work using the .htaccess file set in server settings.

nice mod.
Reply With Quote
  #16  
Old 04-05-2009, 02:35 PM
711 711 is offline
 
Join Date: Oct 2006
Location: CT
Posts: 43
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice hack, very useful :up:

Any reason why lots (nearly half) of my active members would be shown in the Who's Online listing as this:

Unknown Location
/forum/404_forum.php

I'm really stumped.
Reply With Quote
  #17  
Old 04-05-2009, 06:22 PM
711 711 is offline
 
Join Date: Oct 2006
Location: CT
Posts: 43
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by 711 View Post
Nice hack, very useful :up:

Any reason why lots (nearly half) of my active members would be shown in the Who's Online listing as this:

Unknown Location
/forum/404_forum.php

I'm really stumped.
Even when I globally disable the plugin system, I still see

Unknown Location
/forum/404_forum.php

on the Who's Online page as well as member profiles
Reply With Quote
  #18  
Old 04-05-2009, 08:49 PM
JamesAB JamesAB is offline
 
Join Date: Dec 2003
Posts: 125
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by 711 View Post
Nice hack, very useful :up:

Any reason why lots (nearly half) of my active members would be shown in the Who's Online listing as this:

Unknown Location
/forum/404_forum.php

I'm really stumped.
I don't have an answer for you, because this mod does not implement adding the error pages as locations in the Who's Online listings.

I just looked at a forum with about 500 people online and didn't see anything out of the ordinary and I didn't see any viewing these custom error pages.

I suggest you check for other mods you may have installed that might effect the Who's Online list.

Thanks,
James
Reply With Quote
  #19  
Old 04-05-2009, 09:57 PM
711 711 is offline
 
Join Date: Oct 2006
Location: CT
Posts: 43
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by JamesAB View Post
I don't have an answer for you, because this mod does not implement adding the error pages as locations in the Who's Online listings.

I just looked at a forum with about 500 people online and didn't see anything out of the ordinary and I didn't see any viewing these custom error pages.

I suggest you check for other mods you may have installed that might effect the Who's Online list.

Thanks,
James
It happens even when I set the "Enable Plugins" Admin CP setting to "No", so I don't think this is being caused by a plugin (including yours).

I just notice that this didn't start happening until I installed your plugin, and am very confused why it would be showing your 404_forum.php page as the current location.

I even totally uninstalled your mod, but the online location still shows as 404_forums.php.
Reply With Quote
  #20  
Old 04-06-2009, 01:05 AM
711 711 is offline
 
Join Date: Oct 2006
Location: CT
Posts: 43
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Fixed it. It seems the problem was being caused by session variables.

For others who might notice the same issue, simply add the following line near the top of 404_forums.php:

Code:
define('SKIP_SESSIONCREATE', 1);
Reply With Quote
  #21  
Old 04-06-2009, 04:29 PM
djbaxter djbaxter is offline
 
Join Date: Aug 2006
Location: Ottawa, Canada
Posts: 2,601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by 711 View Post
Fixed it. It seems the problem was being caused by session variables.

For others who might notice the same issue, simply add the following line near the top of 404_forums.php:

Code:
define('SKIP_SESSIONCREATE', 1);
That doesn't necessarily fix the problem and what it definitely will do is make your members who reach the error page think they've been logged out when in fact they're still logged in.
Reply With Quote
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:23 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04755 seconds
  • Memory Usage 2,347KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_code
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (6)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete