PDA

View Full Version : Integration with vBulletin - Perfect 404 Error Page


Arcade Fire
10-09-2009, 10:00 PM
Hi!

This is my first mod.

The common 404 error page, makes visitors close our website since it has no navigation. In this way we lose many users as our url has been changed wen remove vBseo, tFseo or other causes.

The modification is simple, create an error page with the internal browser and offer a google search box.

Step 1 - Add New Template
Title: custom_404

Template:

$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<title>$vboptions</title>
$headinclude
</head>
<body>
$header

$navbar

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="tcat">The requested URL was not found on this server.</td>
</tr>
<tr>
<td class="alt1">
<script type="text/javascript">
var GOOG_FIXURL_LANG = 'en';
var GOOG_FIXURL_SITE = 'http://YourSite.com';
</script>
<script type="text/javascript"
src="http://linkhelp.clients.google.com/tbproxy/lh/wm/fixurl.js"></script>

<dd><LI>Back to <A HREF="http://YourSite.com"><b>home page</b></A></dd>

<br><br>


<dd><LI><script type="text/javascript"><!--
google_ad_client = "pub-***********YOUR ID***********";
/* 728x15, creado 13/02/09 */
google_ad_slot = "9714452317";
google_ad_width = 728;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></dd>

</td>
</tr>
</table>

$footer
</body>
</html>Edit:
http://YourSite.com - change for the url of your website two times
google_ad_client = "pub-***********YOUR ID***********"; Enter your PUB number or delete the following if you want to display advertising<br><br>


<dd><LI><script type="text/javascript"><!--
google_ad_client = "pub-***********YOUR ID***********";
/* 728x15, creado 13/02/09 */
google_ad_slot = "9714452317";
google_ad_width = 728;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></dd>Step 2 - Upload 404.php file

Up the attachment to the root of your forum.


Step 3 - Add or change your .htaccess

If you have the file, add the following:

ErrorDocument 404 http://YourSite.com/404.phpif you do not, you can upload the attachment or create it with this content.


.................................................. .........................

Try to work accessing a non existing url
Example: http://www.YourSite.com/tsdsd


DEMO: Sorry, Remove. (http://rotolandia.com/inddfdfdf)

INFO: http://www.google.com/support/webmasters/bin/answer.py?answer=93641&ctx=sibling



Greetings!

Sorry about my English and if this mod is too simple :p

[B]History:

Update 1: #16 (https://vborg.vbsupport.ru/showpost.php?p=1910923&postcount=16)

XHTML Valid [Whithout tables]

https://vborg.vbsupport.ru/external/2009/11/50.jpg

Michael1337
10-10-2009, 09:46 AM
Looks nice, gratz on first Mod (:

Medtech
10-10-2009, 04:23 PM
Thanks!!:)

PixelFx
10-10-2009, 04:40 PM
thanks

segwayon
10-11-2009, 04:05 AM
Very nice!

Black Tiger
10-12-2009, 03:13 PM
Great, I'm going to install this one, thank you! *Marked installed *

Mike08
10-14-2009, 11:34 PM
Reserved to install "Hamijo"

:elrisas:

CSS59
10-15-2009, 12:09 AM
looks good, I needed this!

segwayon
10-15-2009, 01:19 AM
Is there any way of getting a report on what URL might have been requested in order to be redirected to this 404 page? After installing the mod I notice that the WhosOnline page will show this 404.php on occasion, and the page being viewed mentions 'Unknown Location.'

UPDATE: I notice that the online.php page gets listed as this 'Unknown Location -- forum/404.php' within the Who'sOnline. It will list myself as viewing the 404.php page, while I'm actually viewing the online.php page. Any idea on how to fix this bug?

Update2: Could the reason that the online.php page is being erroneously marked as 'Unknown Location - 404.php' is because my online.php page contains some modifications to its template?

Update3: Uninstalled. Hope everyone else's 404 mod is working okay. It looked very nice and did its job, but would cause erroneous 404 markers in the Who's Online page. If it gets a fix I'll be happy to revisit it.

Arcade Fire
11-01-2009, 11:30 AM
Who's Online Modification

If you want to show who is browsing this new page of yours, just open up includes/functions_online.php and find:
case 'bugs.php':
$userinfo['activity'] = 'bugs';
break;



Below, add:
case '404.php':
$userinfo['activity'] = '404 page';
break;




Then find:
case 'modcplogin':
$userinfo['action'] = $vbphrase['moderator_control_panel_login'];
break;

Below add:
case 'custom_404':
$userinfo['action'] = 'Viewing Error Page';
break;

Delifed
11-01-2009, 02:19 PM
Cool looks nice i may have to use. Thanks,

MagicThemeParks
11-01-2009, 02:25 PM
Does the page validate without errors? I haven't added it yet, but I'm planning to do so.

The DEMO is showing 57 errors: http://validator.w3.org/check?uri=http://rotolandia.com/404.php&charset=(detect+automatically)&doctype=Inline&group=0

Arcade Fire
11-03-2009, 04:15 PM
Does the page validate without errors? I haven't added it yet, but I'm planning to do so.

The DEMO is showing 57 errors: http://validator.w3.org/check?uri=http://rotolandia.com/404.php&charset=(detect+automatically)&doctype=Inline&group=0

I try to fix this... :erm:

MagicThemeParks
11-03-2009, 11:29 PM
Thanks Arcade Fire :)

Please let us know when it's fixed because this is a great mod and helps those folks just starting out. :up:

Arcade Fire
11-06-2009, 08:47 AM
@ MagicThemeParks (https://vborg.vbsupport.ru/member.php?u=350155), try with this code:

Update:

XHTML Valid [Whithout tables]

https://vborg.vbsupport.ru/external/2009/11/50.jpg



<?xml version="1.0" encoding="utf-8"?>

<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >

<html xmlns="http://www.w3.org/1999/xhtml">



<head>
<title>
$vboptions[bbtitle]
</title>
</head>
<body>
$header

$navbar
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="tcat">
The requested URL was not found on this server.
</td>
</tr>
<tr>
<td class="alt1"><script type="text/javascript"
xml:space="preserve">//<![CDATA[
var GOOG_FIXURL_LANG = 'en';
var GOOG_FIXURL_SITE = 'http://YourSite.com';
//]]></script> <script type="text/javascript"
src="http://linkhelp.clients.google.com/tbproxy/lh/wm/fixurl.js"
xml:space="preserve"></script> Back to <a
href="http://YourSite.com"><b>home page</b></a> <br /><br /><script
type="text/javascript" xml:space="preserve">//<![CDATA[
google_ad_client = "pub-***********YOUR ID***********";
/* 728x15, creado 13/02/09 */
google_ad_slot = "9714452317";
google_ad_width = 728;
google_ad_height = 15;
//
//]]></script> <script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js"
xml:space="preserve">//<![CDATA[
//]]></script>
</td>
</tr>
</table>
$footer
</body>
</html>


Screenshot:

https://vborg.vbsupport.ru/external/2009/11/51.jpg

segwayon
11-06-2009, 11:40 AM
Who's Online Modification

If you want to show who is browsing this new page of yours, just open up includes/functions_online.php and find:
case 'bugs.php':
$userinfo['activity'] = 'bugs';
break;



Below, add:
case '404.php':
$userinfo['activity'] = '404 page';
break;


. . .



My file doesn't contain a case listing for 'bugs.php'. Is there an alternate location where the new code can be placed?

Arcade Fire
11-06-2009, 12:53 PM
My file doesn't contain a case listing for 'bugs.php'. Is there an alternate location where the new code can be placed?


After or below of:

case 'forumdisplay.php':
$userinfo['activity'] = 'forumdisplay';
break;

segwayon
11-06-2009, 09:58 PM
After or below of:

case 'forumdisplay.php':
$userinfo['activity'] = 'forumdisplay';
break;


Thanks. I altered that function file. The online.php page still shows me as visiting "Unknown Location . . . /forum/404.php" Is there something I missed?

Arcade Fire
11-07-2009, 07:24 AM
Recharge once the browser and you should show the current location. I noticed that not always shown in real time, whether you have installed this mod or not.


Greetings.-

CSS59
11-10-2009, 12:41 AM
i get nothing when i go to : http://www.rotolandia.com/404.php

ghisirds
01-06-2011, 08:12 PM
sorry, but you have to set vBSEO how to run this plugin?
thanks

Arcade Fire
01-08-2011, 10:39 AM
sorry, but you have to set vBSEO how to run this plugin?
thanks

In your vBseo Admin Control Panel you can configure in this file:

- Include custom error page. NOTE: The filename should include the absolute path. (example: /home/user/public_html/error.php)

See screenshot:

https://vborg.vbsupport.ru/external/2011/01/38.jpg

Regards.