jakebur01 Posted July 3, 2007 Share Posted July 3, 2007 hey guys. I need some help. Google is trying to index my pages with session id's attached to them. Ex. = show_cat.php?catid=P70&PHPSESSID=aeg3klbcaeoirjerfodfifs And I don't know if this is right but I put these to lines in my robots.txt but it still didn't work. Disallow: /*?PHPSESSID= Disallow: /*?*PHPSESSID= I am using session_start(); at the beginning of all my pages. What do I need to do? I will be toast if I don't change something. `Jake Quote Link to comment https://forums.phpfreaks.com/topic/58250-session_start-ruining-search-engine-indexing/ Share on other sites More sharing options...
Wildbug Posted July 3, 2007 Share Posted July 3, 2007 [quote=Web Server Administrator's Guide to the Robots Exclusion Protocol]Note also that regular expression are not supported in either the User-agent or Disallow lines. The '*' in the User-agent field is a special value meaning "any robot". Specifically, you cannot have lines like "Disallow: /tmp/*" or "Disallow: *.gif". http://www.robotstxt.org/wc/exclusion-admin.html Quote Link to comment https://forums.phpfreaks.com/topic/58250-session_start-ruining-search-engine-indexing/#findComment-288808 Share on other sites More sharing options...
jakebur01 Posted July 3, 2007 Author Share Posted July 3, 2007 My question is: Should I switch over to using only cookies? Quote Link to comment https://forums.phpfreaks.com/topic/58250-session_start-ruining-search-engine-indexing/#findComment-288811 Share on other sites More sharing options...
Wildbug Posted July 3, 2007 Share Posted July 3, 2007 Some sites do that. "Error: You must have cookies enabled... blah blah blah." http://www.mtdev.com/2002/06/why-you-should-disable-phps-session-use_trans_sid/ Quote Link to comment https://forums.phpfreaks.com/topic/58250-session_start-ruining-search-engine-indexing/#findComment-288822 Share on other sites More sharing options...
jakebur01 Posted July 3, 2007 Author Share Posted July 3, 2007 Well, What would be the best thing for me to do to prevent search engines from try to index hyperlinks with sessions attached to them? Quote Link to comment https://forums.phpfreaks.com/topic/58250-session_start-ruining-search-engine-indexing/#findComment-288824 Share on other sites More sharing options...
Wildbug Posted July 3, 2007 Share Posted July 3, 2007 There are a slew of suggestions in the comments section of that article linked above. These two ini_sets look to be the best solution. ini_set('session.use_trans_sid', false); ini_set('url_rewriter.tags',''); And you can use get_browser() to match "Google" or "MSIECrawler" (you can probably find others) in the user agent string and only run the above restrictions if it's a robot. Bots: http://www.i-asap.net/crawlersdb.php http://www.botsvsbrowsers.com/ Quote Link to comment https://forums.phpfreaks.com/topic/58250-session_start-ruining-search-engine-indexing/#findComment-288839 Share on other sites More sharing options...
xyn Posted July 3, 2007 Share Posted July 3, 2007 Use robots to protect your pages / directories Quote Link to comment https://forums.phpfreaks.com/topic/58250-session_start-ruining-search-engine-indexing/#findComment-288895 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.