Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Topic started by: stylusss on October 28, 2012, 07:21:37 PM

Title: topicseen at the end of a URL
Post by: stylusss on October 28, 2012, 07:21:37 PM
Could some tell me how I could block google from crawling urls that end with topicseen?
Title: Re: topicseen at the end of a URL
Post by: Kill Em All on October 28, 2012, 08:48:25 PM
In your robots.txt file, include:

Disallow: *topicseen
Title: Re: topicseen at the end of a URL
Post by: Oldiesmann on October 30, 2012, 01:04:42 PM
Not sure how Google is even finding those links, as they shouldn't be displayed to guests, but this should take care of it.

Sources/Display.php

Find
// Find the previous or next topic.  Make a fuss if there are no more.

Add before that
if (isset($_REQUEST['topicseen']))
{
$context['robot_no_index'] = true;
}
Title: Re: topicseen at the end of a URL
Post by: stylusss on October 30, 2012, 06:43:25 PM
Does Kill Em All's suggestion work as well? I used his for the time being.
Title: Re: topicseen at the end of a URL
Post by: stylusss on October 31, 2012, 10:11:52 PM
Quote from: Oldiesmann on October 30, 2012, 01:04:42 PM
Not sure how Google is even finding those links, as they shouldn't be displayed to guests, but this should take care of it.

Sources/Display.php

Find
// Find the previous or next topic.  Make a fuss if there are no more.

Add before that
if (isset($_REQUEST['topicseen']))
{
$context['robot_no_index'] = true;
}


I tried your suggestion, Oldiesmann, because I got an error from google, presumably because of Kill em all's suggestion.
Title: Re: topicseen at the end of a URL
Post by: mrintech on November 01, 2012, 02:53:32 AM
Quote from: stylusss on October 31, 2012, 10:11:52 PM


I tried your suggestion, Oldiesmann, because I got an error from google, presumably because of Kill em all's suggestion.

What error?
Title: Re: topicseen at the end of a URL
Post by: stylusss on November 01, 2012, 04:07:30 PM
Quote from: mrintech on November 01, 2012, 02:53:32 AM
Quote from: stylusss on October 31, 2012, 10:11:52 PM


I tried your suggestion, Oldiesmann, because I got an error from google, presumably because of Kill em all's suggestion.

What error?

My adsense said that over 1000 pages couldn't get crawled because of the "topicseen" restriction :-\
Title: Re: topicseen at the end of a URL
Post by: mrintech on November 01, 2012, 04:50:20 PM
Quote from: stylusss on November 01, 2012, 04:07:30 PM


My adsense said that over 1000 pages couldn't get crawled because of the "topicseen" restriction :-\

Just enter this line in robots.txt

Quote
User-agent: MediaPartners-Google
Allow: /

Above lines of code will not restrict AdSense bot from crawling any part of your forum

:)
Title: Re: topicseen at the end of a URL
Post by: stylusss on November 01, 2012, 05:34:04 PM
True, but on the contrary, I don't want adsense crawling:

printpage, *wap*, *wap2*, and *imode*.

So that wouldn't work right?
Title: Re: topicseen at the end of a URL
Post by: mrintech on November 02, 2012, 03:35:17 AM
Then you need to use something like this:

QuoteUser-agent: MediaPartners-Google
Allow: /
Disallow: /*wap2
Disallow: /*wap
Disallow: /*?action


........

:)