Prevent sessions from being stored if from a specific IP?

All about webserver configurations, PHP and databases.

Moderator: Thorsten

Post Reply
dmpp
Posts: 12
Joined: Tue Mar 16, 2010 8:24 pm

Prevent sessions from being stored if from a specific IP?

Post by dmpp »

I have installed PHPmyFAQ on a site, and we're having a few small database issues.

Our search engine (HT Dig) is hitting the FAQ system constantly, and is causing these problems

1. It is exponentially increasing the number of views of all the FAQ's. Some of them are at 1200 views.
2. It is exponentially increasing the number of sessions in the "faqsessions" table.
3. the statistics in the admin panel are therefore inaccurate.

So, is there a way to prevent a specific IP from affecting the views and sessions? We still want the search engine to spider the content though.

We are running 2.6.3.
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Prevent sessions from being stored if from a specific IP?

Post by Thorsten »

Hi,

please add the HT dig user agent to the "bot blacklist" which is in the file config/constants.php:

Code: Select all

/**
 * Bot Blacklist
 *
 * @var array
 */
$botBlacklist = array(
    'nustcrape',
    'webpost',
    'GoogleBot',
    'msnbot',
    'crawler',
    'scooter',
    'bravobrian',
    'archiver',
    'w3c',
    'control',
    'wget',
    'bot',
    'spider',
    'Yahoo! Slurp'
);
If you tell me the user agent of HT dig, I can add this user agent in the 2.6.5 release.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
dmpp
Posts: 12
Joined: Tue Mar 16, 2010 8:24 pm

Re: Prevent sessions from being stored if from a specific IP?

Post by dmpp »

User-agent: htdig
:D
Thorsten
Posts: 15560
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Prevent sessions from being stored if from a specific IP?

Post by Thorsten »

Hi,

thanks, added into 2.6.5. :-)

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply