You are not logged in.

Announcement

Forum database was corrupt and an old backup was restored as temporary replacement. Registrations closed until the database is recovered. Please ask questions using the Contact form

#1 13-04-2014 23:24:18

steebchen
Contributors
From: Germany
Registered: 03-05-2013
Posts: 121

Hide a subsite in google

Hello,
how can I hide a subpage from google search engines, so the only way you can go to this subpage is by link or typing it in the adress bar?

Offline

#2 14-04-2014 08:21:52

chrismaliszewski
Contributors
From: Torun, Poland
Registered: 06-05-2013
Posts: 246
Website

Re: Hide a subsite in google

1. You need to change index.php/mobile.php in line

<META NAME="ROBOTS" CONTENT="INDEX, FOLLOW">

to sth like

<META NAME="ROBOTS" CONTENT="<?php echo $siteRobots;?>">

2. Change config/general.php file and add somewhere above new variable $siteRobots and set its value to default for template:

$siteRobots = "INDEX, FOLLOW";

3. Modify file config/pages.php and add there new array $pageRobots and declare it for all pages you want to have different robot behaviour than default (setting this for other pages is not necessary), i.e.:

$pageRobots['website.php'] = "INDEX, FOLLOW";
$pageRobots['test.php'] = "NOFOLLOW, NOINDEX";

4. Last change in inc/seo.php almost at the bottom. Insert this code below any of if(isset(...)){...} code:

if(isset($pageRobots[$reqUrl])){
	$siteRobots = $pageRobots[$reqUrl];
}

That should be all. Remember to make a copy of all files before testing this code!
Remember also that Thomas suggests that index.php/mobile.php files shouldn't be changed because next versions updates can be a problem but there is no other way for you to do what you want.

Last edited by chrismaliszewski (14-04-2014 08:28:39)

Offline

#3 14-04-2014 15:07:02

steebchen
Contributors
From: Germany
Registered: 03-05-2013
Posts: 121

Re: Hide a subsite in google

Thank you, I'll try that!

Offline

Board footer

Powered by FluxBB