This guide will go through each one of these MAJOR drawback of the phpBB forum and attempt to make it more search engine friendly. However, please take note, no matter how search engine friendly your phpBB forum is you need content, and lots of content. To get content, you need users, posting and participating users. But to get users, you need publicity and good search engine optimization. See the circle that's forming?

Ok, on to topic 01: Dynamic URLs
I like starting off with examples, so here we go
Dynamic URL: http://www.domain.com/foo=123&abc?45615 ... 231546.php
and the opposite of a Dynamic URL is a Static URL
Static URL: http://www.domain.com/foo/123/abc.html
As you can see, the bottom example, the Static URL, is much nicer not only for humans, but for all search engines. Some search engines can crawl Dynamic URLs, but only to a certain extent. Search engines rank static urls higher than dynamic URLs. One way to change Dynamic URLs to Static URLs is to use apache's mod_rewrite. You can do this using the following code:
Code: Select all
##############################################################
## MOD Title: phpBB static URLs mod_rewrite 1.0.0
## MOD Author: Craven de Kere (N/A) http://www.Able2Know.com
## MOD Description: This mod should be added AFTER the Able2Know.com SEO mod
## This mod makes static URLs (only for guests) for phpBB, for example topic-22234.html
## Please read the author notes BEFORE using this mod.
## Check http://www.able2know.com/forums/about15132.html
## for the latest version or to get help with this MOD
##
## MOD Version: 1.0.0
##
## Installation Level: (Advanced)
## Installation Time: 5 Minutes
## Files To Edit: page_header.php,
## Included Files: n/a
##############################################################
## Author Notes:
## Use this mod together with the Able2Know.com SEO Mod (http://www.able2know.com/forums/about15132.html)
## Make backups and test this on a test forum if you can. This is not a typical mod.
## For an additional tutorial on preventing IP addresses from being logged see:
## http://www.able2know.com/forums/about22586.html
##
##############################################################
## MOD History:
##
## 2004-04-10 - Version 1.0.0
## - Initial public release.
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
includes/page_header.php
#
#-----[ FIND ]------------------------------------------
#
//
// Generate logged in/logged out status
//
#
#-----[ AFTER, ADD ]------------------------------------------
#
if ( !$userdata['session_logged_in'] )
{
ob_start();
function replace_for_mod_rewrite(&$s)
{
$urlin =
array(
"'(?<!/)viewforum.php\?f=([0-9]*)&topicdays=([0-9]*)&start=([0-9]*)'",
"'(?<!/)viewforum.php\?f=([0-9]*)&mark=topics'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&watch=topic*'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&unwatch=topic*'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&highlight=*'",
"'(?<!/)viewforum.php\?f=([0-9]*)'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&view=previous'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&view=next'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&postdays=([0-9]*)&postorder=([a-zA-Z]*)&vote=viewresult'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&postdays=([0-9]*)&postorder=([a-zA-Z]*)&start=([0-9]*)'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&start=([0-9]*)&postdays=([0-9]*)&postorder=([a-zA-Z]*)&highlight=([a-zA-Z0-9]*)'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&start=([0-9]*)'",
"'(?<!/)viewtopic.php\?t=([0-9]*)'",
"'(?<!/)viewtopic.php&p=([0-9]*)'",
"'(?<!/)viewtopic.php\?p=([0-9]*)'",
);
$urlout = array(
"topic-\\1-\\2-\\3.html",
"mark-forum\\1.html",
"updates-topic\\1.html",
"stop-updates-topic\\1.html",
"about\\1.html&highlight=\\2",
"forum-\\1.html",
"ptopic\\1.html",
"ntopic\\1.html",
"view-poll\\1-\\2-\\3.html",
"about\\1-\\2-\\3-\\4.html",
"about\\1.html",
"about\\1-\\2.html",
"about\\1.html",
"post-\\1.html",
"post-\\1.html",
);
$s = preg_replace($urlin, $urlout, $s);
return $s;
}
}
#
#-----[ OPEN ]------------------------------------------
#
includes/page_tail.php
#
#-----[ FIND ]------------------------------------------
#
$db->sql_close();
#
#-----[ AFTER, ADD ]------------------------------------------
#
if ( !$userdata['session_logged_in'] )
{
$contents = ob_get_contents();
ob_end_clean();
echo replace_for_mod_rewrite($contents);
global $dbg_starttime;
}
#
#-----[ OPEN ]------------------------------------------
#
.htaccess
#
#-----[ ADD ]------------------------------------------
#
RewriteEngine On
RewriteRule ^forums.* index.php [L,NC]
RewriteRule ^post-([0-9]*).html&highlight=([a-zA-Z0-9]*) post-.html$1&highlight=$2 [L,NC]
RewriteRule ^post-([0-9]*).* post-.html$1 [L,NC]
RewriteRule ^view-poll([0-9]*)-([0-9]*)-([a-zA-Z]*).* about.html$1&postdays=$2&postorder=$3&vote=viewresult [L,NC]
RewriteRule ^about([0-9]*).html&highlight=([a-zA-Z0-9]*) about.html$1&highlight=$2 [L,NC]
RewriteRule ^about([0-9]*).html&view=newest about.html$1&view=newest [L,NC]
RewriteRule ^about([0-9]*)-([0-9]*)-([a-zA-Z]*)-([0-9]*).* about.html$1&postdays=$2&postorder=$3&start=$4 [L,NC]
RewriteRule ^about([0-9]*)-([0-9]*).* about.html$1&start=$2 [L,NC]
RewriteRule ^about([0-9]*).* about.html$1 [L,NC]
RewriteRule ^about([0-9]*).html about.html$1&start=$2&postdays=$3&postorder=$4&highlight=$5 [L,NC]
RewriteRule ^mark-forum([0-9]*).html* forum-.html$1&mark=topics [L,NC]
RewriteRule ^updates-topic([0-9]*).html* about.html$1&watch=topic [L,NC]
RewriteRule ^stop-updates-topic([0-9]*).html* about.html$1&unwatch=topic [L,NC]
RewriteRule ^forum-([0-9]*).html forum-.html$1 [L,NC]
RewriteRule ^forum-([0-9]*).* forum-.html$1 [L,NC]
RewriteRule ^topic-([0-9]*)-([0-9]*)-([0-9]*).* forum-.html$1&topicdays=$2&start=$3 [L,NC]
RewriteRule ^ptopic([0-9]*).* about.html$1&view=previous [L,NC]
RewriteRule ^ntopic([0-9]*).* about.html$1&view=next [L,NC]
#
#-----[ OPEN ]------------------------------------------
#
robots.txt
Disallow: forums/post-*.html$
Disallow: forums/updates-topic.html*$
Disallow: forums/stop-updates-topic.html*$
Disallow: forums/ptopic*.html$
Disallow: forums/ntopic*.html$
#
#-----[ OPEN ]------------------------------------------
#
includes/functions.php
#
#-----[ FIND ]------------------------------------------
#
if (!empty($db))
{
$db->sql_close();
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
if ( !$userdata['session_logged_in'] )
{
if (stristr($url, 'http://')) {
header('Location: ' . $url);
exit;
}
}
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Here are examples of a phpBB forum with and without Session IDs (SIDs)
phpBB forum with SIDs: forum-14.html&sid=4aa4bf80801a783f320ffe34a813de55
phpBB forum without SIDs: /phpBB/viewforum.php?f=14
As you can see, without the Session IDs (SIDs) the url is MUCH cleaner. The most important part to making your phpBB forum search engine optimized and spider crawable is to remove these Session IDs for guests browsing the forum. If you do not remove the Session IDs for guests, then googlebot (google's spider crawler) will not crawl your forum past the front page. The best way to remove session IDs for guests on a phpBB forum is to use the following code:
Code: Select all
#
#-----[ OPEN ]------------------------------------------
#
includes/sessions.php
#
#-----[ FIND ]------------------------------------------
#
$SID = 'sid=' . $session_id;
#
#-----[ REPLACE WITH ]------------------------------------------
#
if ( $userdata['session_user_id'] != ANONYMOUS ){
$SID = 'sid=' . $session_id;
} else {
$SID = '';
}
The linking structure of any website is not only vital for visitors, but also for search engine spiders. If you have poor linking structure (like phpBB) or worse, no linking structure, then not only will the visitors not be able to browser, neither will the spiders. So, the question is, what contributes to a good linking structure. Well, there are two main types of links. They are inbound and outbound links. As you can probable guess, inbound links point from someone else's site to your site. Outbound links point from your site to someone else's. There is also the question of internal linking. Internal linking is when you link to your pages within pages of your site.
Inbound Linking is important. It is through inbound linking that you gain the Google PageRank. There is a mathematical formula for calculating the Google Pagerank, but to put it simply, if you have many pages linking to a certain page of your site, they all give some pagerank to that one site. The higher the pagerank of the site with the link to your page, the higher your pagerank will become. The more inbound links you have to a certain page, the higher that pagerank will become. Pagerank is not the same throughout a website. Pagerank changes on every single page. Generally, the top level page has the highest pagerank because most of the links point to the front page, the subpages usually decrease in pagerank by increments of one. Outbound links do not decrease the pagerank of the page they are on, rather they decrease the amount of pagerank that is given to other pages that the page links to. It is generally accpeted to not have more than thirty outbound links on one page.
One way to increase the Pagerank of your forums is to participate in a link exchange with other forums. This link exchange will not only bring more users to your site, but it will also increase your pagerank and thus search engine placement. Rememmber, when linking to your site, use certain target keywords because google places some emphasis on the anchor text on inbound links. Another way to increase inbound links and thus Pagerank for forums is by submitting to directories. DMOZ and Yahoo are the two main directories, however, there are many more directories that your can get your phpBB forum listed in. An interesting concept that I picked up is the process of going to google and seeing who links to your competition. you can do this by typing this query in google:
Most likely, if someone is willing to link to your competition, they will be willing to link to you.
Internal linking is important for phpBB forums. There are three steps to take to obtain optimum internal linking structure. The first way is to add a "Most Recent Topics" modification to your front page. This modification will provide links from the front page to 15 or more topics embedded in your forum bypassing the loss of one pagerank. Another modification to make involves placing a "Similiar Topics" modification at the bottom of every thread. This links to other threads/topics that are similiar to the topic that the user/search engine is viewing. This is a very optimal transfer of pagerank. The third way to increase internal linking on phpBB forums is to manually add each one of the forum title's and urls to the header. This will allow every page of your site to link to all of the forums. This increases pagerank for each forum, which increases pagerank for each thread, which places each thread higher in search engine results.
Ok, topic 04: Garbage Text Removal for guests on phpBB forums
Lets face it, on the default board, there is too much garbage text that the guest see's compared to the content. Having garbage text on your site doesn't help your search engine placement. This garbage text only detracts from the content of the threads and post, but it also wastes bandwidth. Along with garbage text, is garbage images, and links. What you want to do is limit the un-registered user to the bare minimum, that's each thread's content. As one of my favorite sayings goes: Leave Out The Unnecessary Stuff (LOTUS). You are probably asking how are you supposed to limit the amount of garbage the unregistered forum browser gets. Well, phpBB has made it very simple. They have two tags which you can place in the template (.tpl) files. They are:
Code: Select all
<!-- BEGIN switch_user_logged_in -->
Code: Select all
<!-- END switch_user_logged_in -->
viewforum_body.tpl
Code: Select all
<!-- BEGIN switch_user_logged_in -->
<td><a href="{U_POST_NEW_TOPIC}"><img src="{POST_IMG}" alt="{L_POST_NEW_TOPIC}" title="{L_POST_NEW_TOPIC}" /></a></td>
<!-- END switch_user_logged_in -->
pictures of different posts at the bottom of viewtopic, mark topics, Moderators, browsing users, View Unanswered Posts.
This makes the forums look much cleaner to users and search engine robots and costs you less money for bandwidth.
Overall, if you follow the basic guidelines listed above, post good quality content at least once a day in each forum category, and include some other mods you can think of, you will have a very successfull forum. A modification that I highly recomend is this.