469,592 Members | 1,813 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,592 developers. It's quick & easy.

PHPSESSID, Googlebot and .htaccess

Googlebot has been picking up numerous PHPSESSID name/value pairs in
URIs at my website, and this causes duplicate hits and wasted bandwidth.
I've since prevented PHPSESSID generation in my PHP script if
Googlebot makes the request; like so:

if(preg_match("/googlebot/i", $_SERVER['HTTP_USER_AGENT']) != 1)
//session code here

....but this doesn't stop the PHPSESSID requests from Googlebot because
they're already stored in its database, and it continues to request
query strings like this one:

<hxxp://mysite.com/getdetails.php?personID=I23&tree=num1&PHPSESSID=e0 489b957f2d336974ed7f2d71db2bab>

Therefore, I'd like to use modrewrite (in .htaccess) to permanently
redirect to the same page after stripping out the PHPSESSID name/value
pair..but I'm having great difficult in figuring out how to do this. (I
can strip it if it's the only name/value in the query_string, but not if
there are other name/values in there, as in the example above.) I now
wonder if it's even possible.

Yep, I've Googled exhaustively and you're better than me if you can find
a solution that way.
--
John
Nov 25 '05 #1
0 1536

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by AmigaLemming | last post: by
8 posts views Thread by JohnS | last post: by
3 posts views Thread by edward hage | last post: by
3 posts views Thread by Quinonez | last post: by
3 posts views Thread by James | last post: by
2 posts views Thread by frizzle | last post: by
5 posts views Thread by nigel.t | last post: by
5 posts views Thread by =?Utf-8?B?cGF0cmlja2RyZA==?= | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.