473,387 Members | 1,453 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 1731

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: AmigaLemming | last post by:
As I understand my admins installed a PHP server and now my plain HTML pages also want to set a PHPSESSID cookie when loaded into a browser. Can I suppress this, e.g. by creating a configuration...
8
by: JohnS | last post by:
Hi, When I initially start my browser (any of 'm) and point it to my PHP script the $PHPSESSID is always blank. On all subsequent hits or after a refresh the value for $PHPSESSID is fine... why...
3
by: edward hage | last post by:
Hello , I want to pass some $_SESSION data to another page. I can pass PHPSESSID along using echo '<br /><a href="page2.php?' . SID .. '">page 2</a>'; However, I want to fill in a table...
3
by: Quinonez | last post by:
how can i get the PHPSESSID to not show on the results of a form i have created?
3
by: James | last post by:
PHP is making a right mess at the moment and insists on putting a PHPSESSID in forms, urls and other spots on a script I am running. Is there any way to stop it doing this? Part of the issue is...
2
by: frizzle | last post by:
Hi there I have a site in which all pages ARE php-pages, but they're called/manipulated with htaccess. All files appear as a html-file to surfers. Sometimes i get the PHPSESSID declared in the...
29
by: CAH | last post by:
Hi Can you avoid that googlebot indexes PHPSESSID pages? Googlebot is indexing pages with PHPSESSID, which makes it think my page has a infinite number of pages. How can one avoid this? ...
5
by: nigel.t | last post by:
I have a page that contains just <?php session_start(); $_SESSION = 'HELLO'; $host = $_SERVER; $uri = rtrim(dirname($_SERVER), '/\\'); $extra = '../listings/store.php'; header("Location:...
5
by: =?Utf-8?B?cGF0cmlja2RyZA==?= | last post by:
Hi everyone! I get some errors lately regarding: HTTP_USER_AGENT Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html) and: ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.