ElkArte Community

Project Support => Support => Topic started by: scripple on February 07, 2018, 11:17:38 am

Title: Why is Board Index marked no index?
Post by: scripple on February 07, 2018, 11:17:38 am
So I noticed my forum boardindex is marked robot noindex.  That is xxx.xxx/forum  or xxx.xxx/forum/index.php.

I think it's a bug, but I'm not sure so I'm posting it here.  Move to bug if it is.

The no index is coming from BoardIndexController.php

Code: [Select]
		// Do not let search engines index anything if there is a random thing in $_GET.
if (!empty($this->_req->query))
$context['robot_no_index'] = true;

req->query always has start=0 in it.  This is set in Request.php
Code: [Select]
		// There should be a $_REQUEST['start'], some at least.  If you need to default to other than 0, use $_GET['start'].
if (empty($_REQUEST['start']) || $_REQUEST['start'] < 0 || (int) $_REQUEST['start'] > 2147473647)
$_REQUEST['start'] = 0;

However even commenting out the above in Request.php still causes the robot_no_index to be triggered in BoardIndexController.php even though printing $this->_req->query shows an empty array.  However, replacing the check to match the comment and checking if $_GET is empty then the noindex is not triggered if there are no parameters.
Title: Re: Why is Board Index marked no index?
Post by: scripple on February 08, 2018, 08:04:45 pm
How about this?  Why is it not marked noindex here?
Title: Re: Why is Board Index marked no index?
Post by: emanuele on February 09, 2018, 02:04:40 am
I have had only a phone in the last week, it's kind of difficult to do development there... ;)