Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Template Modifications

Reply
 
Thread Tools
Create 404 Page Details »»
Create 404 Page
Version: 1.00, by ALBCODERS ALBCODERS is offline
Developer Last Online: Dec 2014 Show Printable Version Email this Page

Category: Mini Mods - Version: 4.0.x Rating:
Released: 06-28-2010 Last Update: 12-28-2010 Installs: 44
Template Edits
 
No support by the author.

I am not a proffessional Coder but I just fixed a 404 page for my Forum.
If you want to create one follow me;

Crate a new template wich will called 404_error on your style:

HTML Code:
{vb:stylevar htmldoctype}
<html xmlns="http://www.w3.org/1999/xhtml" dir="{vb:stylevar textdirection}" lang="{vb:stylevar languagecode}" id="vbulletin_html">
  <head>
    {vb:raw headinclude}
<title>Gabim  404 - Faqja nuk u Gjet</title>
  </head>
  <body>
    
    {vb:raw header}
    
    {vb:raw navbar}
    <div id="pagetitle">
<h2 class="blockhead" align="center">404 ERROR</h2>
					
					<h3 class="blocksubhead">ERROR 404  Page Not Found.! </br> (( PUT YOUR CODE OR IMAGE HERE )) </h3>
</br>
{vb:raw footer}
</body>
</html>
Change the text (( PUT YOUR CODE OR IMAGE HERE )) whith your Code that you want.

So Now you need a 404.php lets create one;

PHP Code:
<?php

error_reporting
(E_ALL & ~E_NOTICE);

define('THIS_SCRIPT''404_error');
define('CSRF_PROTECTION'true);
define('CSRF_SKIP_LIST''');
define('VB_ENTRY''404.php');

$phrasegroups = array();


$specialtemplates = array();


$globaltemplates = array('404_error',
);


$actiontemplates = array();


require_once(
'./global.php');

$navbar render_navbar_template(construct_navbits($navbits));

$templater vB_Template::create('404_error');
$templater->register_page_templates();
$templater->register('navbar'$navbar);
print_output($templater->render());

?>
Now open .htaccess file and add this ;
PHP Code:
RewriteEngine On
ErrorDocument 404 http
://www.albcoders.com/404.php 

Download Now

File Type: php 404.php (598 Bytes, 167 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
2 благодарности(ей) от:
askeribilgi, kushal

Comments
  #12  
Old 02-24-2014, 06:08 PM
RichieBoy67's Avatar
RichieBoy67 RichieBoy67 is offline
 
Join Date: Apr 2004
Location: CT - Down in a hole..
Posts: 3,057
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ozzy47 View Post
What?s the use?
On a 404 page usually you want to let people know something went wrong and the page they wanted to see is not available.
But after you let him know what just happened, an advantage the 404 page offers is that you are able to suggest other pages he might want to see or give him instructions to get to an active page. Using a customized 404 page, visitors won?t get confused and leave the website not knowing what happened. If you decide not to have a customized 404 page you should know that a non-customized 404 page can look not so friendly.

Customized 404 Pages and Search Engines
Search engines also can benefit from a 404 page. Imagine that a link is broken and it leads to a non-existent page. At this point search engines can?t go any further and won?t index content. If you choose to have a customized 404 page even though a page is broken search engines will see a page that can be indexed and can find links to pages that could benefit from a crawling. This is an SEO benefit!

404 Pages bring credibility
Having a non-customized 404 page looks unfriendly. But imagine a scenario where a visitor ends up on the 404 page and is shown a nice image, some instructions and links to other pages he might be interested in. He will thing that you really care about his experience on your website and probably he will go to a page you suggested and won?t leave your website or hit the back button
This is what I am using for now and this is very easy, no mod needed. I have had Bf easy pages installed for years for my Privacy statement and TOS so I just used it for a simple html error page and added it into my htaccess. I am using just one error page right now for all the errors but I will make more pages when i have time.

You guys are so right about the importance of this. I had created a bunch of error pages years ago and ended up losing them after theme and script upgrades. i have been doing without them until a couple days ago. It was pretty stupid of me to not have those when I had so many broken urls, etc from Vbseo removal.

Code:
http://musclemecca.com/broken
Reply With Quote
  #13  
Old 04-30-2014, 02:30 PM
Spangle Spangle is offline
 
Join Date: Jun 2011
Posts: 520
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works on 4.2.2 PL1, if you use the second php code
Reply With Quote
  #14  
Old 04-30-2014, 02:58 PM
DreadsUK's Avatar
DreadsUK DreadsUK is offline
 
Join Date: Jan 2014
Posts: 355
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Spangle View Post
Works on 4.2.2 PL1, if you use the second php code
Which one? its confusing.
Reply With Quote
  #15  
Old 04-30-2014, 03:40 PM
ForceHSS ForceHSS is offline
 
Join Date: Apr 2008
Posts: 6,357
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by apokphp View Post
This is the error I get now:
If you are getting this error it means you have not uploaded the file to the correct place it should go into your root or edited the php file correctly
Quote:
Warning: require_once(./global.php) [function.require-once]: failed to open stream: No such file or directory in /home/apokodn/public_html/404.php on line 11

Fatal error: require_once() [function.require]: Failed opening required './global.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/apokodn/public_html/404.php on line 11
Reply With Quote
  #16  
Old 04-30-2014, 03:47 PM
Spangle Spangle is offline
 
Join Date: Jun 2011
Posts: 520
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by DreadsUK View Post
Which one? its confusing.

This one:

Code:
<?php

error_reporting(E_ALL & ~E_NOTICE);

define('THIS_SCRIPT', '404_error');
define('CSRF_PROTECTION', true);
define('CSRF_SKIP_LIST', '');
define('VB_ENTRY', '404.php');

$phrasegroups = array();


$specialtemplates = array();


$globaltemplates = array('404_error',
);


$actiontemplates = array();


require_once('./global.php');

$navbar = render_navbar_template(construct_navbits($navbits));

$templater = vB_Template::create('404_error');
$templater->register_page_templates();
$templater->register('navbar', $navbar);
print_output($templater->render());

?>
Reply With Quote
  #17  
Old 06-05-2014, 08:34 PM
gageb gageb is offline
 
Join Date: May 2013
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

works!!!!! nice
Reply With Quote
  #18  
Old 06-10-2014, 04:47 AM
DemOnstar's Avatar
DemOnstar DemOnstar is offline
 
Join Date: Dec 2012
Posts: 859
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I tried this but it just kept picking up the default style and not the style I am using.
If anybody knows a solution, then please drop it here.

Thanks...
Reply With Quote
  #19  
Old 08-12-2014, 06:49 AM
thetechgenius's Avatar
thetechgenius thetechgenius is offline
 
Join Date: Jun 2014
Posts: 258
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you just want a custom error page without your forum, you could setup the Error Page(s) with .htaccess/web.config.

Example:

.htaccess (unix)
Code:
ErrorDocument 404 /404.htm
ErrorDocument 403 /403.htm
ErrorDocument 500 /500.htm


This is how I did mine, on my Dedicated Box running Windows Server 2008R2. But I really customized my error pages, with CSS, HTML, and Images. Treat the error pages as just another HTML file, and do what you want. Link to a CSS file, an Image, etc... Actually, you can search google for some open source error pages, there are a lot of really nice custom and open source Error Pages out there.

web.config (windows)
Code:
<system.webServer>
	<httpErrors>
	 <remove statusCode="404" subStatusCode="-1" />
	 <remove statusCode="403" subStatusCode="-1" />
	 <remove statusCode="500" subStatusCode="-1" />
	 <error statusCode="404" path="/404.htm" responseMode="ExecuteURL" />
	 <error statusCode="403" path="/403.htm" responseMode="ExecuteURL" />
	 <error statusCode="500" path="/500.htm" responseMode="ExecuteURL" />
	 </httpErrors>
</system.webServer>
This is just another way of adding your own custom error pages, without using your vBulletin Style. All credit still goes to ALBCODERS.
Reply With Quote
  #20  
Old 08-12-2014, 11:00 AM
K4GAP K4GAP is offline
 
Join Date: Mar 2008
Posts: 1,255
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I confiscated the one I'm using. (I'm such a heel)

Can't remember were I saw it but I borrowed it
Reply With Quote
Благодарность от:
doctorsexy
  #21  
Old 10-05-2015, 09:54 AM
friendlymela's Avatar
friendlymela friendlymela is offline
 
Join Date: Dec 2012
Location: Karachi, Pakistan
Posts: 272
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

this is good one
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 11:54 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.06352 seconds
  • Memory Usage 2,350KB
  • 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
  • (1)bbcode_html
  • (2)bbcode_php
  • (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
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (3)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (1)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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • 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