ted_chou12 Posted April 21, 2007 Share Posted April 21, 2007 My website pages (urls) seem to have session ids included in the urls, and i know that will some how effect the search engine prefreces, or anything to the search result, I have no access to the php.ini files, so does anyone know how this problem may be solved through the use of .htaccess files? thanks Ted Quote Link to comment https://forums.phpfreaks.com/topic/47991-php-session-ids-and-search-engines/ Share on other sites More sharing options...
ted_chou12 Posted April 21, 2007 Author Share Posted April 21, 2007 Can anyone please tell me if adding php_value session.use_trans_sid 0 php_value session.use_only_cookies 1 to the .htaccess file in my root directory will work or not? and how to check if that the session ids in the urls are disabled so that I have successfully solved the problem? Thanks again. Quote Link to comment https://forums.phpfreaks.com/topic/47991-php-session-ids-and-search-engines/#findComment-234517 Share on other sites More sharing options...
ted_chou12 Posted April 21, 2007 Author Share Posted April 21, 2007 bump, can anyone answer this please. Quote Link to comment https://forums.phpfreaks.com/topic/47991-php-session-ids-and-search-engines/#findComment-234680 Share on other sites More sharing options...
keeB Posted April 21, 2007 Share Posted April 21, 2007 You would add that to your php scripts Quote Link to comment https://forums.phpfreaks.com/topic/47991-php-session-ids-and-search-engines/#findComment-234687 Share on other sites More sharing options...
ted_chou12 Posted April 21, 2007 Author Share Posted April 21, 2007 but the source of that is saying this is for .htaccess. Quote Link to comment https://forums.phpfreaks.com/topic/47991-php-session-ids-and-search-engines/#findComment-234689 Share on other sites More sharing options...
keeB Posted April 21, 2007 Share Posted April 21, 2007 Then, try it. Quote Link to comment https://forums.phpfreaks.com/topic/47991-php-session-ids-and-search-engines/#findComment-234691 Share on other sites More sharing options...
ted_chou12 Posted April 21, 2007 Author Share Posted April 21, 2007 I already added it, but i dont know whether it had made any effects or not, and i dont know if it will affect my results in the search engines. Quote Link to comment https://forums.phpfreaks.com/topic/47991-php-session-ids-and-search-engines/#findComment-234701 Share on other sites More sharing options...
ted_chou12 Posted April 21, 2007 Author Share Posted April 21, 2007 bump! Quote Link to comment https://forums.phpfreaks.com/topic/47991-php-session-ids-and-search-engines/#findComment-234888 Share on other sites More sharing options...
ted_chou12 Posted April 22, 2007 Author Share Posted April 22, 2007 bump Quote Link to comment https://forums.phpfreaks.com/topic/47991-php-session-ids-and-search-engines/#findComment-235391 Share on other sites More sharing options...
Glyde Posted April 22, 2007 Share Posted April 22, 2007 bump Use the HTTP headers to determine if it's a spider or not. Just simply don't set sessions if it's a spider, or, the all around best way to handle this...use cookies instead of sessions. Quote Link to comment https://forums.phpfreaks.com/topic/47991-php-session-ids-and-search-engines/#findComment-235395 Share on other sites More sharing options...
ted_chou12 Posted April 22, 2007 Author Share Posted April 22, 2007 This is what I wrote, please check if I had done this correctly: <?php //determine if is searchengine or not, and destroy sessions or not $useragent = $_SERVER['HTTP_USER_AGENT']; $result = false; $searchengines = array("bot", "google", "yahoo", "msn"); foreach ($searchengines as $searchengine) { $match = "/$searchengine/i"; if (preg_match($match, $useragent)) {$result = true;}} if ($result == true) {session_destroy();}?> Thanks Ted Quote Link to comment https://forums.phpfreaks.com/topic/47991-php-session-ids-and-search-engines/#findComment-235443 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.