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
  #32  
Old 05-30-2009, 10:20 PM
4nawadir.com's Avatar
4nawadir.com 4nawadir.com is offline
 
Join Date: May 2009
Location: Algeria
Posts: 95
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed & Notaminated , Great looking mod. keep up the good work.

Thanks,
Reply With Quote
  #33  
Old 06-06-2009, 03:20 PM
GhoHan's Avatar
GhoHan GhoHan is offline
 
Join Date: Oct 2007
Location: Jakarta - Indonesia
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ErrorDocument 401 /401_forum.php Not Working on vb 3.8.2
Reply With Quote
  #34  
Old 06-25-2009, 07:10 PM
nohuhu nohuhu is offline
 
Join Date: Dec 2008
Posts: 57
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

a bug found in these scripts: by default they don't modify http header your server gives out with the page so for any of these errors the header will contain 200 OK instead of corresponding error. found this accidentally while trying to find out why google doesn't want to authorize me for my website.
this is easily enough fixed by adding the following line near the top of script:
Code:
header("HTTP/1.0 404 Not Found");
change 404 not found to corresponding error for each file. works for me, at least google stopped complaining.
Reply With Quote
  #35  
Old 06-26-2009, 10:45 AM
Sc00by22 Sc00by22 is offline
 
Join Date: Mar 2008
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed, works perfectly

Do I put header("HTTP/1.0 404 Not Found"); near the top of the file "404_forum.php"
Reply With Quote
  #36  
Old 06-27-2009, 04:22 PM
nohuhu nohuhu is offline
 
Join Date: Dec 2008
Posts: 57
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sc00by22,

i'd recommend you to do so. in my experience, 404 is one of the most important error codes and giving out 200 OK when a page is not found can be very misleading for search engines. their crawlers don't actually read pages content, you know, they rely on http status codes.
Reply With Quote
  #37  
Old 06-27-2009, 04:28 PM
deadlySniper deadlySniper is offline
 
Join Date: Dec 2008
Location: New York
Posts: 211
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice, thanks.
Reply With Quote
  #38  
Old 11-11-2009, 04:08 AM
TheInsaneManiac TheInsaneManiac is offline
 
Join Date: Feb 2008
Posts: 1,360
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I get a white page with the http errors on it...
Reply With Quote
  #39  
Old 11-16-2009, 02:14 AM
Abdullah SZ Abdullah SZ is offline
 
Join Date: Mar 2008
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by nohuhu View Post
a bug found in these scripts: by default they don't modify http header your server gives out with the page so for any of these errors the header will contain 200 OK instead of corresponding error. found this accidentally while trying to find out why google doesn't want to authorize me for my website.
this is easily enough fixed by adding the following line near the top of script:
Code:
header("HTTP/1.0 404 Not Found");
change 404 not found to corresponding error for each file. works for me, at least google stopped complaining.
Can someone tell if this should be after <?php or before?

Quote:
Originally Posted by TheInsaneManiac View Post
I get a white page with the http errors on it...
Same here.
Reply With Quote
  #40  
Old 01-31-2010, 02:32 AM
egclive egclive is offline
 
Join Date: Dec 2009
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

is this going to be modded for vb4.0
Reply With Quote
  #41  
Old 04-14-2012, 02:27 AM
egclive egclive is offline
 
Join Date: Dec 2009
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Will this work on vbuleltin 4 series lol
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 02:34 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05384 seconds
  • Memory Usage 2,339KB
  • 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
  • (2)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
  • (2)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