Forum Moderators: Robert Charlton & goodroi

Message Too Old, No Replies

Will PHPSESSID hurt my ranking?

will G or others get confused or index dupes?

         

Tearabite

8:29 pm on Mar 8, 2006 (gmt 0)

10+ Year Member



I've started up a data-base driven forum that does not fully support 'search engine friendly' URLS (nor does my host).
When viewing the forum, before clicking any links, the link has something like PHPSESSID=9439392903092xx992 appended to the URL.. once you click into the first page, the PHPSESSID goes away.
The people in the user support forum at SMF (the forum software) indicate that PHPSESSID is nothing to worry about and Google, MSN, Yahoo and everyone else understands what it is and will ignore it..

What do the experts here at WW say? Will this cause duplicates, or will it make the forum difficult to spider, or any other issues?

trinorthlighting

9:57 pm on Mar 8, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is it a shopping cart format? I am using Zen Cart and they have a switch to prevent spiders from indexing the session ID's/ I used cube cart in the past and it added all the session ID's to my url. Made quite the mess.

Tearabite

10:09 pm on Mar 8, 2006 (gmt 0)

10+ Year Member



not a shopping cart.. just a plain forum.

trinorthlighting

2:13 am on Mar 9, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, the session id's will screw up indexing. See if you can some how turn them off.

Tearabite

3:39 pm on Mar 9, 2006 (gmt 0)

10+ Year Member



Does anyone have any more info regarding these PHPSESSID's on URLS and how it will or will not affect indexing?

the folks over at the SMF forums say the 100% opposite(PHPSESSID won't hurt anything)..

i'm stuck in the middle not knowing who's right..

FWIW: there is apparantly NO way to turn off the SESSID's with the version of Apache that my host uses and they way they run PHP as CGI (or something)..

stu_uk

6:20 pm on Mar 9, 2006 (gmt 0)

10+ Year Member



ideally the search engines are supposed to be able to account for session ids but they still seem to cause problems from time to time.

I usually just edit the forum code to remove session Ids for unregistered users.

g1smd

6:24 pm on Mar 9, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Every page of your site will be indexed with several thousand URLs, all of them just having a different session. This will cause a lot of harm. Get rid of session IDs for all users that are not logged in.

Kufu

7:47 pm on Mar 9, 2006 (gmt 0)

10+ Year Member



Session IDs are no good, even URLs that look like they have session IDs are no good. For example if you have:

[myxyzsite.com...]

the 'id' portion may be mistaken for a session ID, and cause spiders to turn away.

kulinar

7:50 am on Mar 10, 2006 (gmt 0)

10+ Year Member



I had more than 4'000 urls containing PHPSESSID indexed by GOOGLE. I read somewhere that PHPSESSID in url is a security risk. That is why I searched around the internet and found this solution that works for me:

1. In .htaccess add following lines:

#removing PHPSESSID from URL
php_value session.use_only_cookies 1
php_value session.use_trans_sid 0

You will stil use session IDs but they will not be vissible in URLs.

2.If you have URLs containing PHPSESSID already indexed, add to the .htaccess:

Options +FollowSymlinks
RewriteEngine On

RewriteCond %{QUERY_STRING} ^PHPSESSID=.*$
RewriteRule .* %{REQUEST_URI}? [R=301,L]

After appying this two thigs Now I have about 1300 indexed URLs containing PHPSESSID.

The only thing that still bothers me are URLs containing &PHPSESSID=... I tried:

RewriteCond %{QUERY_STRING} ^&?PHPSESSID=.*$

instead of

RewriteCond %{QUERY_STRING} ^PHPSESSID=.*$

but no success :(.

mvandemar

8:25 am on Mar 10, 2006 (gmt 0)

10+ Year Member



RewriteCond %{QUERY_STRING} ^&?PHPSESSID=.*$

Is that exactly how you tried it? If so, you have your? and & swapped. Also, I'm not sure but you might have to escape the? with a backslash:
RewriteCond %{QUERY_STRING} ^\?&PHPSESSID=.*$

That will only work if the PHPSESSID is at the start of the querystring though, I'd try it with the ampersand and without the question mark.

-Michael

kulinar

9:43 am on Mar 10, 2006 (gmt 0)

10+ Year Member



Well, I put questionmark not as symbol but to make the preceding token in the regular expression optional so I do not have to escape it.

ansible

2:53 pm on Mar 10, 2006 (gmt 0)

10+ Year Member



I had a PHPSESSID problem with cubecart but fixed it over time. Once you do get the problem taken care of, you should add the following line to your robots.txt file:

Disallow: /*PHPSESSID

This will (over time) remove all PHPSESSID pages indexed by search engines. You should also invest some time in doing a google sitemap. In your sitemap.xml, only list URLs that do not contain PHPSESSIDs. This should speed up the process with google. Also in your google sitemaps account, you'll see in the Errors section: "URLs restricted by robots.txt". There you can see a very long list of the old PHPSESSID plagued URLs that will no longer be indexed. :)

All of the urls that should be indexed (but that were plagued by PHPSESSIDs) should get reindexed with the non-PHPSESSID url over time as well. That was my experience at least.

Tearabite

5:40 pm on Mar 10, 2006 (gmt 0)

10+ Year Member



I upgraded my forum software (Simple Machines) to their newest v1.1rc2 - this is supposed to have some code that will strip out the SESSID for bots and spiders.. i ran a spider test from an SEO site, and it looks like it works..

Hopefully i'll get more than just my index page in MSN/Google in a few days (well, days for MSN, weeks for G)
..

kulinar

7:14 pm on Mar 10, 2006 (gmt 0)

10+ Year Member



@ansible

That is really very simple and powerful solution.

Will try. 10x.

g1smd

12:08 am on Mar 11, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



RewriteCond %{HTTP_USER_AGENT} "Google" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "Slurp" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "MSNBOT" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "teoma" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "ia_archiver" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "Scooter" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "Mercator" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "FAST" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "MantraAgent" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "Lycos" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "ZyBorg" [NC]
RewriteCond %{QUERY_STRING} SESSIONID
RewriteRule ^(.*)$ $1? [L,R=301]