vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Miscellaneous Hacks - vB4 Error Pages (https://vborg.vbsupport.ru/showthread.php?t=281410)

gezuvor 04-10-2012 10:00 PM

vB4 Error Pages
 
1 Attachment(s)
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.

I modified JamesAB's Custom HTTP Error Pages hack for vB3.8, so credit is due him for the original coding!

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.

Files: 5
Templates: 5
Time: 10 minutes
Compatible: 4.x.x

The templates are very basic and are designed to work with the default style. You may need to tweak them for your forum. They are grouped together under HTTP Error Templates.

The errors messages are fully phrased, but pretty generic. I encourage you to edit them to best suit your site. Each page uses three different vBulletin phrases:
  • navbit
  • title
  • message

I include a modified copy of the vBulletin default .htaccess file in the mod. If you are not already using .htaccess, or if your existing file is the default vbulletin one, you are welcome to simply upload this to the root of your webserver and/or replace the existing file.

DO NOT DO THIS if you have made changes to the default file or if you have a custom file!

Please mark Installed and let me know if there are any issues or suggestions!

gezuvor 04-11-2012 06:18 AM

Reserved.

sweetpotato 04-12-2012 01:10 PM

Really interesting, Just downloaded but feel it is difficult to work with .htaccess. Will try this well I have more free time.
Thanks,

Emeralda 04-12-2012 01:17 PM

I think I have to first create the .htaccess file, but I dunno how >.<

gezuvor 04-12-2012 01:51 PM

Unfortunately, vBulletin does not have a built-in error capturing system, hence we have to rely on other internet technologies to solve this problem.

Working with .htaccess can be daunting to the uninitiated, but once you get the hang of it they are very powerful files.

There are lots of resources on the web that address .htaccess and a quick search will lead to any number of helpful tutorials.

I would offer to help further, but it's been sliced & diced 1,000 different ways already...

sweetpotato 04-14-2012 02:33 PM

I use Vbulletin .htaccess file and added these lines:
Code:

ErrorDocument 400 /400.php
        ErrorDocument 401 /401.php
        ErrorDocument 403 /403.php
        ErrorDocument 404 /404.php
        ErrorDocument 500 /500.php

Just installed and see it works. I will report if these is any problem.
Thank you for the nice mod. Really useful because I don't want user to see some error such as database errors.

Emeralda 04-15-2012 11:17 AM

Where is vBulletin's .htaccess file stored? I haven't found one myself >.<

sweetpotato 04-15-2012 11:23 AM

In the do_not_upload--->Rewrite--->Apache2

Emeralda 04-15-2012 03:49 PM

And where do I later put it in?

sweetpotato 04-15-2012 04:40 PM

In apache2 folder you will see .htaccess file. Just open it by notepad and copy and paste these lines at the end of .htaccess file:

Code:

        ErrorDocument 400 /400.php
        ErrorDocument 401 /401.php
        ErrorDocument 403 /403.php
        ErrorDocument 404 /404.php
        ErrorDocument 500 /500.php

Finally, upload the .htaccess to your forum root.
It works fine for me for the time being. I will report if there is any problem.

gezuvor 04-16-2012 02:56 AM

I have included a modified copy of the vBulletin default .htaccess file in the mod now. If you are not already using .htaccess, or if your existing file is the default vbulletin one, you can simply upload this to the root of your webserver and/or replace the existing file.

DO NOT DO THIS if you have made changes to the default file or if you have a custom file!

Crotan 04-16-2012 04:55 AM

Easy, Simple and just plain works! Thank You!

gezuvor 04-16-2012 04:36 PM

Glad to hear it, thanks!

temsamane 04-18-2012 09:12 AM

is this tweak also compatible for custom themes? PRO theme

Crotan 04-18-2012 12:45 PM

Quote:

Originally Posted by temsamane (Post 2321200)
is this tweak also compatible for custom themes? PRO theme

The pages skinned to the custom style on my board no problem.

gezuvor 04-18-2012 02:37 PM

Quote:

Originally Posted by temsamane (Post 2321200)
is this tweak also compatible for custom themes? PRO theme

It depends on how heavily modified your theme is. I wrote this hack only to work with the default, so you might need to tweak it a little bit if there are some serious changes to your forum look & feel.

I am running custom themes on my forums and have modified this hack slightly to better blend in with them, but it would have still worked w/o those changes...

Naijasite 09-30-2012 09:40 PM

i just installed it on 4.2.0. when i navigate to www.domain.com/404.php the error page shows.
I deleted a page to see it will show me your error page...it did not it's still showing vbulletin error page No Thread specified. If you followed a valid link, please notify the administrator

I av added the ErrorDocument on my.htssacess file below. Though my .htacess file had been customized.

Please why has it not change the vbulletin error page to the one i installed?

TheSupportForum 09-30-2012 10:18 PM

Quote:

Originally Posted by Naijafinder (Post 2369859)
i just installed it on 4.2.0. when i navigate to www.domain.com/404.php the error page shows.
I deleted a page to see it will show me your error page...it did not it's still showing vbulletin error page No Thread specified. If you followed a valid link, please notify the administrator

I av added the ErrorDocument on my.htssacess file below. Though my .htacess file had been customized.

Please why has it not change the vbulletin error page to the one i installed?

use this version
https://vborg.vbsupport.ru/showthread.php?t=287936
it works 100% also ensure you follow details i posted for it here
https://vborg.vbsupport.ru/showpost....0&postcount=11

qpurser 10-01-2012 05:06 AM

Thanks for this nice mod.
Installed it on my test server and the error pages look very nice.

However I have a small issue:
I followed your instructions for installing and changing the .htaccess file.

When I go to
Code:

http://mydomain.com/~tcmasorg/forums/401.php
the page shows up without any problems
but then after a few seconds I get automatically redirected to a blank page and I saw in my browser address:

Code:

http://mydomain.com/~tcmasorg/forums/
Is this normal or did I do something wrong with the .htaccess file?
for reference here is my .htaccess file:

Code:

RewriteEngine On

RewriteRule ^Classifieds/([^/]*)/ ./classifieds.php?do=main&catid=$1 [L,NC]
RewriteRule ^For-Sale/([^/]*)/ ./classifieds.php?do=viewitem&itemid=$1 [L,NC]
RewriteRule ^Wanted/([^/]*)/ ./classifieds.php?do=viewitem&itemid=$1 [L,NC]
RewriteRule ^Auction/([^/]*)/ ./classifieds.php?do=viewitem&itemid=$1 [L,NC]
RewriteRule ^Seller/([^/]*)/ ./classifieds.php?do=browseuser&userid=$1 [L,NC]
RewriteRule ^Archives/([^/]*)/ ./classifieds.php?do=viewarchived&itemid=$1 [L,NC]

# Send hardcoded ipa scores to arcade instead
  RewriteCond %{QUERY_STRING} act=Arcade [OR]
  RewriteCond %{QUERY_STRING} autocom=arcade
  RewriteRule ^index.php arcade.php [L,QSA]

        ErrorDocument 400 /forums/400.php
        ErrorDocument 401 /forums/401.php
        ErrorDocument 403 /forums/403.php
        ErrorDocument 404 /forums/404.php
        ErrorDocument 500 /forums/500.php

Thanks for any help

TheSupportForum 10-01-2012 06:25 AM

ok so ensure that there is no white spaces for

ErrorDocument 400 /forums/400.php
ErrorDocument 401 /forums/401.php
ErrorDocument 403 /forums/403.php
ErrorDocument 404 /forums/404.php
ErrorDocument 500 /forums/500.php

&

# Send hardcoded ipa scores to arcade instead
RewriteCond %{QUERY_STRING} act=Arcade [OR]
RewriteCond %{QUERY_STRING} autocom=arcade
RewriteRule ^index.php arcade.php [L,QSA]

there should be no spaces before or after

you dont need to type anything for the errors

as long as you have this mod active and fopr example

if you type

blahblah.php it will show the appropriate error
the redirects are auto

see if you type

http://mydomain.com/~tcmasorg/forums/

it works

qpurser 10-02-2012 05:36 AM

Quote:

Originally Posted by simonhind (Post 2369921)
ok so ensure that there is no white spaces for

ErrorDocument 400 /forums/400.php
ErrorDocument 401 /forums/401.php
ErrorDocument 403 /forums/403.php
ErrorDocument 404 /forums/404.php
ErrorDocument 500 /forums/500.php

&

# Send hardcoded ipa scores to arcade instead
RewriteCond %{QUERY_STRING} act=Arcade [OR]
RewriteCond %{QUERY_STRING} autocom=arcade
RewriteRule ^index.php arcade.php [L,QSA]

there should be no spaces before or after

you dont need to type anything for the errors

as long as you have this mod active and fopr example

if you type

blahblah.php it will show the appropriate error
the redirects are auto

see if you type

http://mydomain.com/~tcmasorg/forums/

it works

Thanks for the reply.
As mentioned I had no issues with the new error page showing up.
I am just confused why there is a need for the immediate redirection to the main forum page.

Michael

TheSupportForum 10-02-2012 06:43 AM

Quote:

Originally Posted by qpurser (Post 2370137)
Thanks for the reply.
As mentioned I had no issues with the new error page showing up.
I am just confused why there is a need for the immediate redirection to the main forum page.

Michael

you have set that to your homepage which is why it will redirect to your homepage

John Lester 10-16-2012 07:56 PM

I totally forgot to comment on this mod :( It's awesome! Saved me the hassle of creating each page myself, thank you :)

Naijasite 10-16-2012 08:35 PM

i like this mod but it dosen't work with my vbseo ..it still showed vbulletin default page

gezuvor 11-05-2012 04:38 AM

I'm working on this a bit more now. I updated to 4.2.0 PL2 and it's not functional, with or without vbSEO installed.

Will update as soon as I can get it running again!

Gadget_Guy 11-23-2014 03:10 PM

Any updates on this mod for 4.2.2 PL2

Reason I ask....

The pages display with the error, but on re-direct instead of going to my forum home it goes to:

https://www.toronto-subaru-club.com/forums/blogs/all/


How can I get it to go to: https://www.toronto-subaru-club.com/forums/forums.php


D.


All times are GMT. The time now is 03:20 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
  • Page Generation 0.01291 seconds
  • Memory Usage 1,797KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (26)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete