Hey all another problem with my site, someone told me this my site is sigtraders.com "but session ID's in your URL's is going to kill your SERPS!" Could someone explain what they are talking about, and could anyone help me fix it heres what a few ppl suggested. "Also you can get rid of the SESSIONID with the following code snippets" set_magic_quotes_runtime(0); ini_set('session.use_only_cookies', true); ini_set ('url_rewriter.tags', ''); /* session.use_trans_sid cannot be changed via ini_set as it The decision to enable the rewriter is made before your script starts running. */ PHP: Reply 2 "You could try adding these two lines before you start your session." ini_set('session.use_trans_sid', false); ini_set("url_rewriter.tags",""); session_start(); PHP: Reply 3 "It's even easier than that, there is a line you can put in the .htaccess file that will disable session ids." php_flag session.use_trans_sid off put that in your .htaccess file in the root directory, should disable the php session ids in the url What do you guys think is the best option ?
Google doens't index pages with phpsessions, use the php code to disable sessions ini_set('session.use_trans_sid', false); Code (markup): I haven't got experience by doing it in .htaccess
Im using the one from abletoknow however there are more out there. Have a look at these two: http://www.phpbb.com/phpBB/viewtopic.php?t=185839 http://www.able2know.com/forums/viewtopic.php?t=15132
I create a php.ini file and put it in the root of my sites where sessions are possible. Just that one file, with the following: url_rewriter.tags = "" session.use_trans_sid = 0 session.use_cookies = 1 session.use_only_cookies = 1 Code (markup):
Hey Gtech thanks for the tip, can anyone confirm i can use this method and it wont damage my site in any way ?
It will damage your site. People with cookies disabled will not be able to maintain a session (i.e. login, access member areas, etc). If that's not a problem, then go with it.
Agreed, after reading the php manual, that's about the jest of it. vBulletin has some stuff in it to let google and a few others spider without sessions. If you have access to that code, I would suggest using it for an example. Of course the code is copyrighted, but the idea aint.
Incorrect, it will not damage your site. These are the same commands as noted in the first post (combined), but in a .ini file as opposed to having to enter them in multiple .php files as code. You could build a function in PHP that enables these via PHP, if you determine a search engine bot is active. <? $browser = array ("Gigabot","msnbot", "Googlebot", "Slurp","AltaVista","Scooter","appie","ArchitextSpider","BSDSeek","crawler@alexa.com","BSDSeek","AOL","Jeeves","T-H-U-N-D-E-R-S-T-O-N-E"); $isBot = 0; while (list ($key, $val) = each ($browser)) { if (strstr (strtolower($_SERVER['HTTP_USER_AGENT']), strtolower($val))) { $isBot = 1; } } if ($isBot) { ini_set('session.use_only_cookies', true); ini_set('session.use_cookies', true); ini_set ('url_rewriter.tags', ''); ini_set('session.use_trans_sid', false); } ?> Code (markup): Second part is an accurate assessment. If someone has cookies disabled, it would prevent session logins, if you have a login method on your site, or sessions are used to store important data (such as cart checkout information). It is a trade-off. The same assessment applies to the PHP scripted methods in post one, as does using the php.in I posted though.
Sorry to be pedantic, but that's what I meant, it will 'damage' his site in the context of handling sessions without cookies.
did i read wrong, or did gttech intend to create php.ini in his root directory? please don't do that. the php.ini already exists at the server level and is more or less a 'config' file for the php interpreter. you may or may not have permission to edit it, depending on who the server gods are where you worship. the alternative to changing the the scripture is to ammend it in your .htaccess file.