Log in

View Full Version : php code


dansurge
02-09-2016, 02:03 PM
<?php
if (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') {
echo '<meta name="robots" content="noindex,follow">'. "\n";
}
?>

How do I add this code into Vbulletin 3.89 Header?

--------------- Added 1455054033 at 1455054033 ---------------

Want to stop bots from duplicate content now that the site has both https and http versions. It was a breeze adding the above php code to wordpress, vbulleting throws warning errors when I place the code in the header. Any feedback as to a solution for the above code in vbulletin header, or work around duplicate http and https pages for a vbulletin forum.

MarkFL
02-09-2016, 07:44 PM
I would create a plugin as follows:

Product: vBulletin

Title: Add meta Tag

Execution Order: 5

Plugin PHP Code:

if (isset($_SERVER['HTTPS']) AND strtolower($_SERVER['HTTPS']) == 'on') {$spacer_close .= '<meta name="robots" content="noindex,follow">'. PHP_EOL;}

Plugin is Active: Yes

Click "Save."

dansurge
02-09-2016, 08:01 PM
I would create a plugin as follows:

Product: vBulletin

Title: Add meta Tag

Execution Order: 5

Plugin PHP Code:

if (isset($_SERVER['HTTPS']) AND strtolower($_SERVER['HTTPS']) == 'on') {$spacer_close .= '<meta name="robots" content="noindex,follow">'. PHP_EOL;}

Plugin is Active: Yes

Click "Save."
Thank you, what info would I choose in the "Hook Location" options?

--------------- Added 1455056840 at 1455056840 ---------------

I do not have a hook location header_head... Only header_redirect... I'm using Dragonbyte so not sure which hook location to choose. dbtech_dbseo_process_content_meta (Dragonbyte Tech:seo lite))

or a golbal_start? header_redirect?

--------------- Added 1455060664 at 1455060664 ---------------

HOOK LOCATION? did I miss a step?

MarkFL
02-09-2016, 10:07 PM
I am so sorry for leaving that out...:o

Hook Location: parse_templates

dansurge
02-09-2016, 10:56 PM
I am so sorry for leaving that out...:o

Hook Location: parse_templates

Ha Left me hanging! But hey, the free help here is better than ANYTHING available. Dude thank you it worked perfect and verified in "view source". You are the man! I'm looking for a good programmer if you know someone...;)