PDA

View Full Version : Mini Mods - HTTP Error Response Codes by BOP5 (Help reduce "soft 404" errors for improved SEO)


BirdOPrey5
03-10-2014, 11:00 PM
Brought to you by BirdOPrey5 / Qapla.com (http://www.qapla.com/mods/)

This issue was brought to my attention by Sherrie at TAZ in this thread (http://www.theadminzone.com/forums/showthread.php?t=107470).

The issue is that when Google crawls a site and runs into the vBulletin No Permission message or other standard vBulletin error pages vBulletin gives the standard "200" HTTP response code which means everything is OK, even though there is no real content on these pages. Therefore Google considers these "soft errors" and they can damage overall SEO of your site if there are too many of them.

What this does is make vBulletin return standard HTTP "Error" responses- by default 403 (Not Authorized) for No Permission pages and 404 (Not Found) for general error messages. When Google sees these responses (as opposed to 200) it knows not to bother indexing the page and everyone is happy.

As of version 2.2 new options have been added to return custom response codes when the forum is closed or when the forum is busy. It will also send a retry header telling the crawler they can try again later. As of version 2.0 there is also a separate response code for search.php errors.

A limitation of this mod is it works best with PHP 5.4.0 or higher. As of version 2.0 If you are on an older version of PHP it may not work, but it should not cause any errors, so it is worth trying.

There are no instructions, once installed it is enabled by default. In Admin CP -> Settings -> Options -> HTTP Error Responses by BOP5 you can enable/disable the mod and choose the response codes you want for the two different error types. You can use any standard HTTP response code available from this list at wikipedia (http://en.wikipedia.org/wiki/List_of_HTTP_status_codes).

The mod works fine on VB 3.x or 4.x including VB 3.8.8 (still in Beta) and VB 4.2.2.

To test that it is working use a free online status checker such as: http://httpstatus.io/
(Note the site will cache your result for a while so test with a unique URL each time.)

Before you install the mod any URL that will show a no-permission or other vBulletin error will show a status code of 200. After installing the same page will show a 403, 404, or other code that you have configured.

Added Boothby as a "co-author" as thanks for his contribution of code and ideas. :up:

------------------------------------------------------

Please "Mark as Installed" if you use this. :)
Donations always appreciated. :up:
Nominate MOTM if you LOVE it! ;)

BirdOPrey5
03-11-2014, 04:59 PM
Reserved

Abu2
03-12-2014, 06:42 PM
On 3.8.4:
This product is not compatible with version 5.1.6 of PHP. (Compatible starting with 5.4.0) :(

BirdOPrey5
03-12-2014, 07:11 PM
On 3.8.4:
This product is not compatible with version 5.1.6 of PHP. (Compatible starting with 5.4.0) :(

Hello,

Please read the first post- it explains the problem.

The major limitation of this mod is it requires PHP 5.4.0 or higher. If you are on older versions of PHP the mod will not install.

atcspaul
04-01-2014, 12:43 AM
great mod bop, i just checked with my host and they said this:
Sure, we can upgrade PHP version on your server.

The PHP version you are using currently is PHP v5.2.11. Hence, I would suggest you to check your site scripts by getting in touch with your developer since most of the functions in PHP v5.2.11 are deprecated in PHP v5.4. So, if you blankly do an upgrade to PHP v5.4 it may cause many errors in sites and it may even not load.

my computer skills are limited so i will watch for updates :(

BirdOPrey5
04-01-2014, 12:53 AM
Make sure you are running VB 3.8.8 Beta before they upgrade your site's PHP.

atcspaul
04-01-2014, 01:11 AM
ohh thanks bop, i am using 3.8.7 and will wait till 3.8.8 gets out of beta, i am an old man and they were inventing calculators when i was in school so not real good with computers so minor things take me forever to figure out and fix, thank you again and as i said great mod

Zachery
04-01-2014, 04:27 AM
Any reason you can't use header for PHP versions lower than 5.4?

BirdOPrey5
04-01-2014, 09:16 AM
ohh thanks bop, i am using 3.8.7 and will wait till 3.8.8 gets out of beta, i am an old man and they were inventing calculators when i was in school so not real good with computers so minor things take me forever to figure out and fix, thank you again and as i said great mod

3.8.8 Beta 4 is as stable as any other version. You can wait if you wish but it is going to be months before it is out of beta, there is no rush to get it out of beta.

Any reason you can't use header for PHP versions lower than 5.4?

The header function can only be called before any output is sent to the browser and in my tests output has already been sent by the time these hooks are executed resulting in the changes not being made.

Zachery
04-01-2014, 09:19 AM
Ah, that does make some sense then.

BirdOPrey5
05-21-2014, 02:50 PM
New as of Version 2.0 - No more PHP 5.4.0+ requirement. Should now work on older PHP versions as well.

New as of Version 1.1 - Added response code for search page errors/

atcspaul
05-21-2014, 04:38 PM
great job and thank you, I installed and going to see how it does,

Gadget_Guy
05-21-2014, 06:45 PM
Sees to be working fine for me

VB 3.8.7

PHP 5.2.17

Putting in a "protected" URL into that test site you provided responds with "403"

This is a section someone has to be a "registered user" to see.

D.

BirdOPrey5
05-23-2014, 09:05 AM
Updated to version 2.2. Added options for board closed, and board too busy. Added Boothby as supporter/co-author.

atcspaul
05-25-2014, 02:11 AM
working awesome, all soft errors are gone and only have access denied and not found errors :) nominated mod of the month

Gadget_Guy
05-27-2014, 02:02 PM
Update,

It turns out that this mod does not work after-all for MY system.

Users are getting a lot of these errors:

When person tried to register:

Fatal error: Call to undefined function http_response_code() in /home/XXXXX/public_html/forums/includes/functions.php(2953) : eval()'d code on line 65

No new threads message and failed CSS loads

Fatal error: Call to undefined function http_response_code() in /home/XXXX/public_html/forums/includes/functions.php(2953) : eval()'d code on line 43

VB 3.8.7
PHP 5.2.17

Is this something to expect with the version of PHP I have?

D.

Gadget_Guy
05-27-2014, 02:06 PM
Additional question.....

Would it be a good or bad thing to have my hosting company upgrade the version of PHP to 5.4.x ?

Are there any downsides to upgrading the PHP version?

D.

BirdOPrey5
05-27-2014, 02:33 PM
Update,

It turns out that this mod does not work after-all for MY system.


Users are getting a lot of these errors:

When person tried to register:

Fatal error: Call to undefined function http_response_code() in /home/XXXXX/public_html/forums/includes/functions.php(2953) : eval()'d code on line 65


No new threads message and failed CSS loads

Fatal error: Call to undefined function http_response_code() in /home/XXXX/public_html/forums/includes/functions.php(2953) : eval()'d code on line 43


VB 3.8.7
PHP 5.2.17


Is this something to expect with the version of PHP I have?

D.

Oh, that is my bad. I know what I did wrong... Let me make a quick update. The problem is only on VB 3.x.

BirdOPrey5
05-27-2014, 02:45 PM
Updated to version 2.1.1. Fixed error on for VB 3.x users on legacy PHP versions (below 5.4.0)

This will fix your issue @Gadget_Guy.

I forgot to include the VB3 version of one of the plugins.

Gadget_Guy
05-27-2014, 02:55 PM
Thanks!

What about my other question in regards to "should I upgrade my PHP"

D.

BirdOPrey5
05-27-2014, 03:30 PM
Oh, PHP performs better for sure than 5.2 or 5.3, however some mods may not work correctly with it.

You must upgrade to VB 3.8.8 if you have PHP 5.4.x. If you have a VB4 or VB5 license getting VB 3.8.8 is no big deal but if you don't that's going to be an expensive upgrade.

Bottom line- if it's possible and you have a VB4 or 5 license, sure go ahead- but be on the look out for the occasional mod that will malfunction.

But if you don't have the money or your host won't upgrade, don't worry about it too much.

Gadget_Guy
05-27-2014, 04:22 PM
Update installed.

I will monitor and let you know if there are any issues.

What's the highest PHP version I can run with my 3.8.7 version?

FWIW.... my plan is to upgrade to 4.x or 5.x sometime this year.

Just need to wrap my head around doing it. I am fearing breaking the forums and something breaking in a bad way.

;)

D.

Zachery
05-27-2014, 05:00 PM
Update installed.

I will monitor and let you know if there are any issues.

What's the highest PHP version I can run with my 3.8.7 version?

FWIW.... my plan is to upgrade to 4.x or 5.x sometime this year.

Just need to wrap my head around doing it. I am fearing breaking the forums and something breaking in a bad way.

;)

D.

388/422 will run on PHP 5.4.x without issues
5.1.1+ should run fine on php 5.5.
We're currently testing 5.6 stuff atm for the 5.1.x+ line.

BirdOPrey5
05-27-2014, 06:28 PM
VB 3.8.7 tops out on PHP 5.3.x, don't use PHP 5.4.0 or higher. Make sure warnings / deprecated notices are turned off in PHP.

Gadget_Guy
05-28-2014, 10:37 PM
Still experiencing issues.

Getting the following complaints from users:

The time to wait before retying the page fetch/search has been different every time the page doesnt load. 5, 6, 3, 10 seconds thus far, on separate occurrences.

When I click on "My Posts", I get an "Invalid user specified" message. The "My Threads" link works though. Very odd.

I get the no new threads message and failed CSS load so the the page is all messed up.

Still getting the error for my threads showing need to wait. Still not able to get videos, pictures and now URLs when linked through the [] brackets. Using chrome. Cleared caches, didn't change anything and still getting worse.

Just tried new posts link, now getting an error for it.

Looks like the time at the bottom of the page isn't updating properly, still thinks its 11am and 2pm.



https://www.toronto-subaru-club.com/forums/attachments/forum-information-how-tos-feedback-etc/23379d1401304830-new-posts-link-not-working-error1tsc.jpg



Does it make a difference that I use SSL and a Content Distribution service?

D.

BirdOPrey5
05-29-2014, 12:00 AM
Please uninstall the mod and see if the issues go away- I don't believe those issues could be related to this mod. SSL and a CDN should not matter.

Gadget_Guy
05-29-2014, 01:51 AM
I disabled the mod... is this enough?

I will monitor the site for a couple days and if the issues go away I think we can narrow it down to this mod.

D.

BirdOPrey5
05-29-2014, 07:01 PM
I disabled the mod... is this enough?

I will monitor the site for a couple days and if the issues go away I think we can narrow it down to this mod.

D.

In theory yes, but in theory this mod wouldn't cause the issues you are having to begin with... I would just uninstall since it isn't difficult to re-install or setup.

Gadget_Guy
05-29-2014, 09:50 PM
Thanks Joe,

I am completely stumped as to what could be causing this issue.

The only things I did at the same time as this mod were:

1) install new Google Analtyics code (which I have since removed)

2) Update TapaTalk (which I have disabled)

3) Installed his Mod (which I have disabled)

I asked the users to continue to monitor, but they are still seeing the issue.

so frustrating.

I'm sort of glad that it isn't this Mod, I hope I can put it back in place because it is really a valuable MOD for any forum to have.

D.

Zachery
05-29-2014, 10:49 PM
Did you start using a load balancer?

Gadget_Guy
05-30-2014, 12:13 AM
Not that I am aware of.

I opened a ticket with my hosting company for them to check logs and stuff.

Maybe they will find something.

D.

samba7
04-27-2015, 07:30 PM
nice!:up: