加拿大华人论坛 美国华人新闻Optimizing phpBB 2.0.xx for Search Engines, Page Rank, and S



在加拿大


Building a Web Server, a Step-by-Step Instruction GuideGuide -- Optimizing phpBB 2.0.xx for Search Engines, Page Rank, and SecuritySearch Engines -- Getting your Forums IndexedProblem: Search Engine bots (spiders, crawlers) will not index pages that contain Session IDs (sid) in URLsExample:URLs that will not be indexed...http://forums.domain.com/index.php?sid=c80e688fbf4ec5347f170b3e4r2067b7http://forums.domain.com/viewtopic.php?t=1689&sid=c80e688fbf4ec5347f170bURLs that will be indexed...http://forums.domain.com/index.phphttp://forums.domain.com/viewtopic.php?t=1689*Note that Session IDs are normally stored in cookies; otherwise they are transferred via the URL. For Session IDs to be visibly present in the URL, cookies have to be turned off under your browser's settings.Solution:Selectively remove Session IDs from URLs.Method one:Remove Session IDs for specific Search Engine bots by recognizing their 'User-Agent' HTTP header strings.Example of 'User-Agent' strings that are received on every HTTP request...Google -- "Googlebot/2.1 (+http://www.google.com/bot.html)"MSN -- "msnbot/0.3 (+http://search.msn.com/msnbot.htm)"Yahoo -- "Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp)"Benefits: This method does not remove Session IDs from non-logged in users (guests); allowing guests to posts.Downside:(1) While the 'User-Agent' strings of the major Search Engine bots are known, some lesser-known bots will be missed.(2) The 'User-Agent' string of a bot can change from time to time; an updated list must be kept.Edit file 'includes/sessions.php'Replace function...(last function in file)function append_sid($url, $non_html_amp = false){ global $SID; if ( !empty($SID) && !preg_match('#sid=#', $url) ) { $url .= ( ( strpos($url, '?') != false ) ? ( ( $non_html_amp ) ? '&' : '&' ) : '?' ) . $SID; } return $url;}with function...function append_sid($url, $non_html_amp = false){ global $SID; if ( !empty($SID) && !preg_match('#sid=#', $url) && !strstr($_SERVER['HTTP_USER_AGENT'] ,'Googlebot') && !strstr($_SERVER['HTTP_USER_AGENT'] ,'msnbot') && !strstr($_SERVER['HTTP_USER_AGENT'] ,'Slurp') && !strstr($_SERVER['HTTP_USER_AGENT'] ,'almaden.ibm.com') && !strstr($_SERVER['HTTP_USER_AGENT'] ,'zyborg') && !strstr($_SERVER['HTTP_USER_AGENT'] ,'Jeeves') && !strstr($_SERVER['HTTP_USER_AGENT'] ,'crawler') && !strstr($_SERVER['HTTP_USER_AGENT'] ,'spider') ) { $url .= ( ( strpos($url, '?') != false ) ? ( ( $non_html_amp ) ? '&' : '&' ) : '?' ) . $SID; } return $url;}Method two:Remove Session IDs for all non-logged in (guest/anonymous) users.Benefits: All Search Engine bots will be able to crawl and index forum.Downside: Users will need to be registered and logged-in to have the ability to post.Under Administration Panel -- Forum Admin -- Permissions : switch all forums to "Registered"Edit file 'includes/sessions.php'Replace line...$SID = 'sid=' . $session_id;with line...if ( $userdata['session_user_id'] != ANONYMOUS ){ $SID = 'sid=' . $session_id; } else { $SID = ''; }Search Engines -- robots.txtProblem: Search Engine bots will try to index all available pages/links under the forum. Some of these pages/links have no value, can be harmful to page rank, and should not be indexed.Solution:Create phpBB forum root level file 'robots.txt'; specifying pages/links not to be indexed.Method:There are only 3 pages/links that are beneficial to page rank, that should be indexed...(1) /index.php(2) /viewforum.php(3) /viewtopic.phpEvery other page/link should be disallowed.View phpBB root level directory/file structure; disallow everything but the above 3 pages/links...Contents of 'robots.txt'...User-agent: *Disallow: /admin/Disallow: /db/Disallow: /images/Disallow: /includes/Disallow: /language/Disallow: /templates/Disallow: /common.phpDisallow: /config.phpDisallow: /faq.phpDisallow: /groupcp.phpDisallow: /login.phpDisallow: /memberlist.phpDisallow: /modcp.phpDisallow: /posting.phpDisallow: /privmsg.phpDisallow: /profile.phpDisallow: /search.phpDisallow: /viewonline.phpThe first line specifies a match for all Search Engines.The following lines state that any link that starts with the given text should not be indexed.Page RankProblem: The most valuable (local) text for page rank is located in the title of the page. phpBB adds text to the title of a page that takes up valuable space.Example:URL /index.php : "SITENAME :: Index"URL /viewforum.php : "SITENAME :: View Forum - forum name here"URL /viewtopic.php : "SITENAME :: View topic - topic text here"Solution:Remove the unnecessary text.Method:Remove general "SITENAME" text from all pages...Edit file 'templates/subSilver/overall_header.tpl'Replace line...{SITENAME} :: {PAGE_TITLE}with line...{PAGE_TITLE}Replace the index page "Index" text with site name or keyword text...Edit file 'language/lang_english/lang_main.php'Replace line...$lang['Index'] = 'Index';with line...$lang['Index'] = 'Your-site-name Forums or keyword text';Remove "View Forum - " text...Edit file 'viewforum.php'Replace line...$page_title = $lang['View_forum'] . ' - ' . $forum_row['forum_name'];with line...$page_title = $forum_row['forum_name'];Remove "View topic - " text...Edit file 'viewtopic.php'Replace line...$page_title = $lang['View_topic'] .' - ' . $topic_title;with line...$page_title = $topic_title;Cosmetic ChangesRemove the intrusive phpBB logo...Method:Edit file 'templates/SubSilver/overall_header.tpl'Delete or comment out (with ) line...Hyperlink the sitename back to your main site...Method:Edit file 'templates/SubSilver/overall_header.tpl'Edit line...{SITENAME}with line...{SITENAME} - ForumsSecurityProblem: phpBB displays "Powered by phpBB 'version'" at the bottom of each page. This allows an individual to search Google, or any other Search Engine, for all domains/websites that are running specific older versions of phpBB -- which are known to have vulnerabilities and exploits.Solution:Update phpBB version string to '2.x.x'.Method:Login into MySQL. Enter SQL query...REPLACE INTO phpbb2.phpbb_config (config_name, config_value) VALUES('version', '.x.x');Source: http://www.devside.net/web/config/phpBB

  ·生活百科 Payid 诈骗者的个人经历
·生活百科 国内不同快递服务的差异

美国华人新闻-加拿大

富坚义博开通推特

华人网摘要:经漫画家村田雄介和集英社确认,该账号为富坚本人。 图源:twitter 5月23日,推上出现了一个ID为富坚义博的新账号,简介上写着这是一个报告原稿进度的“官方()”并发布了一 ...

美国华人新闻-加拿大

日本议员提议立法禁止AV

华人网摘要:日本立宪民主党众议员堤かなめ在25日众议院内阁委员会上表示,立宪民主党将 "禁止涉及性行为的色情制品 "为目标制定法律。 日本立宪民主党众议员堤かなめ在25日众议院内阁 ...

美国华人新闻-加拿大

师村妙石的创新篆刻作品

华人网摘要:师村妙石,日本著名艺术家、篆刻家、书法家,一直致力于中日友好活动和文化交流,长期专攻中国传统篆刻技法。师村妙石先生曾223次访问中国进行书法研究和文化交流(截至 ...

日本,每年一次全民体检
美国华人新闻-加拿大

日本,每年一次全民体检

华人网关注我,带你看看普通人的日本生活。我家附近每隔两三百米就有一块告示板,类似于国内“居委会”或者“社区”的通知,平时大事小情都能在这里看到。前几天看到了有免费筛查宫 ...

美国华人新闻-加拿大

师村妙石的编著书影

华人网摘要:师村妙石,日本著名艺术家、篆刻家、书法家,一直致力于中日友好活动和文化交流,长期专攻中国传统篆刻技法。师村妙石先生曾223次访问中国进行书法研究和文化交流(截至 ...