Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Template Modifications
FAQ Community Calendar Today's Posts Search

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
  #2  
Old 07-01-2010, 05:42 PM
wolfe wolfe is offline
 
Join Date: Jan 2002
Posts: 900
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nice also used this to do a 500 error page
Reply With Quote
  #3  
Old 07-25-2010, 01:58 AM
apokphp apokphp is offline
 
Join Date: Nov 2002
Posts: 440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can't get this to work (I'm using 4.0.5). This is the error message I get:

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 32

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 32
This is apparently the code in question:
Code:
31 // ######################### REQUIRE BACK-END ############################
32 require_once('./global.php');

I can change my .htaccess and use your link (to your 404.php) and it works fine. But with my own link to my own 404.php file, I get errors.

This is my .htaccess file:

Quote:
<Files 403.shtml>
order allow,deny
allow from all
</Files>

deny from 128.241.46.107
deny from 199.67.140.154
deny from 199.67.140.83
deny from 209.136.124.178
deny from 24.255.4.133
deny from 65.73.24.110
deny from 68.0.166.100
deny from 68.105.138.218
deny from 68.111.15.15
deny from 68.226.22.66
deny from 68.231.184.133
deny from 68.231.185.12
deny from 68.231.185.219
deny from 68.231.189.51
deny from 69.9.30.7
deny from 72.211.152.125
deny from 72.211.156.96
deny from 72.211.157.157

RewriteEngine On
ErrorDocument 404 http://www.onlinedebate.net/404.php

ErrorDocument 403 /403.shtml

ErrorDocument 500 /500.shtml

RewriteCond %{HTTP_REFERER} !^http://onlinedebate.net/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://onlinedebate.net$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.onlinedebate.net/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.onlinedebate.net$ [NC]
RewriteRule .*\.()$ - [F,NC]
Reply With Quote
  #4  
Old 07-25-2010, 11:52 AM
ALBCODERS ALBCODERS is offline
 
Join Date: Apr 2009
Posts: 84
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try this :

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());

?>
I dont have 4.0.5 my last version is 4.0.3
Reply With Quote
  #5  
Old 07-25-2010, 06:39 PM
apokphp apokphp is offline
 
Join Date: Nov 2002
Posts: 440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is the error I get now:

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
  #6  
Old 07-25-2010, 06:44 PM
apokphp apokphp is offline
 
Join Date: Nov 2002
Posts: 440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I suspect the issue is w/ the global. I recall reading in another thread that 4.0.5 does something differently in its global calls.
Reply With Quote
  #7  
Old 06-28-2011, 06:47 AM
River J River J is offline
 
Join Date: Jun 2011
Posts: 73
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

there's easier ways to do this
Reply With Quote
  #8  
Old 02-06-2014, 05:55 PM
GamerUnguided GamerUnguided is offline
 
Join Date: Dec 2012
Location: UK
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i did this but the only problem is it logs the user out :/
Reply With Quote
  #9  
Old 02-16-2014, 01:44 AM
SPEEDKILLZ SPEEDKILLZ is offline
 
Join Date: Feb 2011
Location: USA
Posts: 641
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What Would This Be Used for?
Reply With Quote
  #10  
Old 02-16-2014, 09:56 AM
ozzy47's Avatar
ozzy47 ozzy47 is offline
 
Join Date: Jul 2009
Location: USA
Posts: 10,929
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
4 благодарности(ей) от:
gsmlover4u, K!nG, Papa Bear, RichieBoy67
Reply


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 08:37 AM.


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.04776 seconds
  • Memory Usage 2,350KB
  • Queries Executed 24 (?)
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
  • (1)bbcode_code
  • (1)bbcode_html
  • (3)bbcode_php
  • (3)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
  • (10)post_thanks_box
  • (6)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)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