![]() |
Remove Bot SIDs from URL Requests
Hack 1: vB303_remove_bot_sids_1.txt
Okay so I notice that there are some bots where SIDs are in the requests. One such bot is msnbot, and who knows of the current code behind this bot, but it seems that it treats each different SID as a new link. Here is a quick and dirty hack to prevent this. You need the $_SERVER['HTTP_USER_AGENT'] and $_SERVER['REQUEST_URI'] array elements or their equivalents to use this mini hack. The first step of the hack prevents SIDs in new requests. The second step forces a redirect in order to strip the SIDs from links in the bot memory. There is no need to apply this hack for bots that have google or slurp@inktomi or yahoo! slurp as part of their user agent. Like I said, it is a quick and dirty hack, but it does what I need it to do. If you use this mod, a click of the install button is appreciated. Hack 2: vB303_remove_bot_sids_2.txt Do the following to see a list of bots that may appear on the Who's Online list: AdminCP >> vBulletin Options >> Who's Online Options >> Spider Identification Strings & Enable Spider Display & Spider Identification Description However, according to http://www.vbulletin.com/forum/showthread.php?t=112022, the user agents that don't receive session IDs are hard coded in the sessions.php file. The bots that are hard coded are as follows: google, slurp@inktomi, yahoo! slurp Thus the bots for the "who's online list" versus the bots in the "remove SID list" are currently not the same. This hack removes the session ids from the list of bots in the vBulletin Options rather than from those that were hard coded in the script. It may be the case that pages were already crawled by a bot not hard coded in the "remove SID list" so those bots may spider with session ids in the requests. This hack includes an optional step to remove session ids from such bots via redirect. |
Quote:
|
so this helps in getting results for msn search and some others?
sorry im just kinda confused. |
Quote:
|
If a bot isn't on a remove SID list, and then it crawls, it gets a SID, and when it comes back to respider, the bot has the SID in the respider request because it was assigned a SID initally. What is suggested may strip SIDs from bot requests that are new, but for respider requests, if the bot was initially assigned a SID, the bot remembers the SID, so the SID is in the respider request. In my situation, I didn't have msnbot on a remove SID list, so after some time, the bot was making quite a lot of respider requests for the same pages but using different SIDs. By the time I realized what was happening, I was out a good chunk of bandwidth so this is the type of situation where I think this hack is useful.
|
Quote:
|
I'm not talking about how bots show up in the who's online list. The only place in the vB code where I see sessions removed for bots is in the sessions.php file:
PHP Code:
Because msnbot was not in the preg_match statement, msnbot had SIDs in all requests until I applied this hack. Please check this thread. Maybe it explains it better than I can. BTW, are you checking your raw server access logs? I don't see how putting msnbot in vBoptions removes the SID from requests. |
Quote:
AdminCP > vBulletin Options > Who's Online Options > Spider Identification Strings & Spider Identification Description Enter an unique identifier for each Search Engine spider that you wish to recognize. This should be something unique to the spider's HTTP USER AGENT. Please place one per line. Case is not important and the previous option needs to be enabled for identification to occur Enter the text that you wish to display for each of the above spiders on Who's Online. You need to place the spiders description on the same line as the spider's identifier above. For example, if you place 'google' as the third spider above, place 'Google' on the third line to the right. |
Please read this vB.com thread. It indicates that the "who's online list" and the "remove SID list" are not the same. That thread is dated from August. Has something in the vB code changed since August? Where in the code are bot SIDs removed from the who's online list?
|
yes, that filter related to the WOL would be better to be applyed globally to the SID list, so we can really filter what kind of spider can browse the site... i have built that feature in IPB, so i suppose it's easy to do for vB!
|
Someone should integrate the 2. :) It would not be too hard.
|
Okay, the second hack in the first post of this thread uses the bots listed in the vBulletin Options.
|
calorie thank you! Just by accident I noticed that the two IPs using most of my bandwidth were msnbot and jetbot these days. And the logs revealed that they were constantly browsing my forum with new session strings. A nightmare!
Notice though that for vB303_remove_bot_sids_2 you could probably use the datastore cache, thus saving one costly query. |
I'm really confused.... what is msnbots unique identifier.... and what do I need to do so they dont get sids....
|
Always apprehensive about adding hacks when it adds additional load to the server (more lines of code). But this one looks to reduce the amount of downloads that the spiders will potentially make. So it should mean less bandwidth and less server load from the bots.
Good hack. |
SO, what is the final conclusion about this all?
Is there a hack or update available? thx |
Has this been resolved?
|
Instructions say "$zzzz_domain_tld = "http://www.yourdomain.tld"; //////////// CONFIGURE THIS VARIABLE - NO ENDING SLASH *************"
Is it www.mydomain.tld or www.mydomain.com? |
The vB 3.0.6 code in includes/sessions.php still *cough* does a hard remove of SIDs from bot requests.
- as of vB 3.0.3: (google|slurp@inktomi|yahoo! slurp) - as of vB 3.0.4: (google|slurp@inktomi|yahoo! slurp) - as of vB 3.0.5: (google|slurp@inktomi|yahoo! slurp) - as of vB 3.0.6: (google|msnbot|yahoo! slurp) This means that setting WOL bots via vBoptions does not automatically imply removal of SIDs from every bot request. Note that WOL settings versus SID removal are two different things, as of the last time I checked (see this thread). For as much as Zachery is a sweetie, as of vB 3.0.6, WOL bots via vBoptions do not automatically remove SIDs from every bot request. Both hack1 and hack2 posted should still work for vB 3.0.3 through vB 3.0.6., and while I briefly looked at datastore, hack2 still uses a query. Also note that, although MSNbot was added in includes/sessions.php as of vB 3.0.6, it will not prevent MSNbot (or any other bot) from making requests with SIDs if said bot has already requested pages using SIDs. That is where the optional portion of the hacks comes into play! I have modified my optional portion, to be placed at the start of includes/init.php, as shown below. Of course, you could PHP include the code just the same. Now, you need to realize that the below code is rather 'buttoned down' in that listed bots can only crawl forumdisplay, showthread, printthread, and index, and only certain query string type pieces related to those pages. I worked my optional portion this way because I have no need for bots to consider, for example, showthread.php?t=xyz&page=a&pp=A different from showthread.php?t=xyz&page=a&pp=B, index.php? different from index.php, etcetera. In my mind, robots.txt and meta tags options, etcetera, are not quite flexible enough, and do not have a fast enough response. Rather, I choose to 'button down that hatch' so to speak with forced 301s as shown below. Of course, the below code does not preclude the use of a .htaccess file (your OS willing) so, whatever you do, the way you decide to handle bots is ultimately up to you, your OS willing. Code:
|
I'm confused :ermm:
|
Here is just one example where a bot indexed a thread, before vB 3.0.6 was released, and still remembers the SID even though reindexing a vB 3.0.7 board:
Code:
207.46.98.56 - - [26/Feb/2005:10:31:06 -0800] "GET /forum/showthread.php?s= 6f58fd4a031cc78ad7043cdfa0de3287 &t=952 HTTP/1.0" 301 0 "-" "msnbot/1.0 (+http://search.msn.com/msnbot.htm)" |
All times are GMT. The time now is 04:33 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|