Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 10-26-2008, 05:06 AM
Ironduke Ironduke is offline
 
Join Date: Dec 2006
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Custom 404 pages

We've recently decided not to re-install vBSEO on our forum, and in the mean time, we have alot of 404 pages on Google.

How do I go about creating a custom 404 page that otherwise displays the forum instead of a blank page... I've seen stuff on the vBSEO forum but we have decided to not install vBSEO and the code posted there doesn't work.
Reply With Quote
  #2  
Old 10-26-2008, 09:16 AM
pedigree pedigree is offline
 
Join Date: Jul 2005
Posts: 370
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You need to edit the .htaccess file in the root of your install and add this

ErrorDocument 404 /index.php

That will make all 404 pages load the forum homepage
Reply With Quote
  #3  
Old 10-26-2008, 11:42 AM
UKBusinessLive UKBusinessLive is offline
 
Join Date: Sep 2008
Location: Essex, United Kingdom
Posts: 1,637
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Ironduke View Post
We've recently decided not to re-install vBSEO on our forum, and in the mean time, we have alot of 404 pages on Google.

How do I go about creating a custom 404 page that otherwise displays the forum instead of a blank page... I've seen stuff on the vBSEO forum but we have decided to not install vBSEO and the code posted there doesn't work.
I posted this a couple of weeks ago on my forum....

Custom 404 Pages

"Not found

The requested URL /file.html was not found on this server.

Apache/1.3.14 Server at www.yourdomain.com Port 80"

Does that look familiar? If you've ever accidentally tried to access a page that doesn't exist, possibly by following an outdated link or by misspelling the name of the page, you've probably seen something like the above appear on your screen. You might have attempted to correct the error by checking the URL for mistakes, but it is even more likely that you just clicked "Back" and returned where you came from, never visiting the site again.

For a surfer, encountering a "404 page" is a nuisance. For a webmaster, they can be far more problematic, causing a reduction in traffic which in turn means losing a part of the precious advertising revenues or sales the site's life depends on. You can minimize the amount of 404 errors by periodically checking your pages for broken links, but it is impossible to get completely rid of them. So, what can you do?

The solution - Custom 404 pages

The best way to avoid losing visitors to 404's is to replace the standard and unfriendly error message with a custom page. Fortunately the task is relatively simple and can be performed by anyone who owns a site that has its own domain name.

As different server softwares handle things in their own ways, there is no single method of creating a custom error page that works with every system. The following instructions can be applied by those who have sites hosted under Apache, which is a very widely used program. If you don't know what software your host is running, contact them and ask.

To start the process, use an FTP program such as CuteFTP to connect to your server. Search for a file named ".htaccess". Should you find it, download the file to your home computer for editing. If the file is not there, don't worry, you'll just have to create it yourself.

Grab a normal text editor and open the file, or if you don't have it, open up a blank file. Type the following into the first line of the file:

ErrorDocument 404 http://www.yourdomain.com/404page.html

After you're done, save the file as plain text and make sure that it is named ".htaccess", without quotes of course. The hard part is now over, all that is left is to create the custom 404 page (404page.html) that loads when a 404 error occurs.

What should my 404 page look like?

Of course, you can put anything you want into it, but if your purpose is to encourage your visitors to click further into your site instead of leaving, the page should obey some basic principles.

1. Don't give users a reason to panic. Including a large heading that screams "ERROR" is likely to make the visitor feel that he/she has done something wrong or that your site is not working properly. A better approach is to first greet them with a warm welcome and then explain that the URL they were looking for could not be found, but should they browse around your site, they will surely find the information they need.

2. Make the page to look and feel similar to the rest of the pages on your site. Include your site's menu on the 404 page to give visitors a fast and easy way to continue exploring instead of clicking away. A well-designed 404 page with plenty of links is far more attractive than one that has just black text on a white background and a link to your homepage.

3. If you have the skills, consider adding a search feature on the page that allows people to search your site for matches. Often your navigation menu will provide a clue on how the user might reach the information he/she would like to see, but if it doesn't there is a great risk of losing the visit. Placing a search utility on the page increases the likelihood of the user finding the desired page and thus remaining on your site.

After both the .htaccess file and the HTML page are ready, FTP to your server, upload the pages and enjoy your new custom 404 error page!
Reply With Quote
  #4  
Old 10-26-2008, 06:30 PM
Ironduke Ironduke is offline
 
Join Date: Dec 2006
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Do you have any ideas for incorporating aspects of the functionality of my vBulletin homepage into the 404 page without making it a simple redirect?
Reply With Quote
  #5  
Old 10-26-2008, 06:48 PM
SEOvB's Avatar
SEOvB SEOvB is offline
 
Join Date: May 2007
Location: Indianapolis
Posts: 2,451
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Ironduke View Post
Do you have any ideas for incorporating aspects of the functionality of my vBulletin homepage into the 404 page without making it a simple redirect?
You should actually contact vBSEO and get them to make you a set of rewrite rules to redirect all their URL's to the vBulletin standard ones so you dont lose out on everything completely.

What functionality of your homepage are you looking to add to the 404 page, I've got a custom one which you can see at http://seotips4.com/forum/24u89054uhjeri0 if you're looking for some idea's
Reply With Quote
  #6  
Old 10-26-2008, 07:04 PM
Ironduke Ironduke is offline
 
Join Date: Dec 2006
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by FRDS View Post
You should actually contact vBSEO and get them to make you a set of rewrite rules to redirect all their URL's to the vBulletin standard ones so you dont lose out on everything completely.

What functionality of your homepage are you looking to add to the 404 page, I've got a custom one which you can see at http://seotips4.com/forum/24u89054uhjeri0 if you're looking for some idea's
I already have lost out completely -- the site needs to be completely reindexed. Google will get around to it sooner or later.

I'd just like to have a 404 page that includes the banner, navbar on my site.
Reply With Quote
  #7  
Old 10-26-2008, 09:15 PM
anderow anderow is offline
 
Join Date: Jun 2008
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Ironduke View Post
I already have lost out completely -- the site needs to be completely reindexed. Google will get around to it sooner or later.

I'd just like to have a 404 page that includes the banner, navbar on my site.
You will lose any page rank that you may have accumulated on all of those pages though...but if they dont have any its not such a problem
Reply With Quote
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 03:49 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.06262 seconds
  • Memory Usage 2,226KB
  • Queries Executed 11 (?)
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)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)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_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete