|
Most
of the search engines penalize the phpBB forums because of their
Dynamic URLs. If you use Apache webserver, you can use mod-rewrite
functionality to write the dynamic URL as static URL. The whole
process will take 10 minutes, but you will definitely see the increase
in no of pages indexed by search engines (google, yahoo, msn etc..).
Before
Adding This MOD To Your Forum, You Should Back Up All Files Related
To This MOD
OPEN in a text editor like Textpad or notepad.
#
#-----[ OPEN the following file]------------------------------------------
#
includes/page_header.php
#
#-----[ FIND The following lines]------------------------------------------
#
//
// Generate logged in/logged out status
//
#
#-----[ AFTER those lines, 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 the following file]------------------------------------------
#
includes/page_tail.php
#
#-----[ FIND the following line in the file]------------------------------------------
#
$db->sql_close();
#
#-----[ AFTER the line, ADD ]------------------------------------------
#
if ( !$userdata['session_logged_in'] )
{
$contents = ob_get_contents();
ob_end_clean();
echo replace_for_mod_rewrite($contents);
global $dbg_starttime;
}
#
#-----[ OPEN the following file, if you don't have one open an empty
file in notepad and save it as .htaccess]------------------------------------------
#
.htaccess
#
#-----[ ADD the following lines in the in to the file]------------------------------------------
#
RewriteEngine On
RewriteRule ^forums.* index.php [L,NC]
RewriteRule ^post-([0-9]*).html&highlight=([a-zA-Z0-9]*) viewtopic.php?p=$1&highlight=$2
[L,NC]
RewriteRule ^post-([0-9]*).* viewtopic.php?p=$1 [L,NC]
RewriteRule ^view-poll([0-9]*)-([0-9]*)-([a-zA-Z]*).* viewtopic.php?t=$1&postdays=$2&postorder=$3&vote=viewresult
[L,NC]
RewriteRule ^about([0-9]*).html&highlight=([a-zA-Z0-9]*) viewtopic.php?t=$1&highlight=$2
[L,NC]
RewriteRule ^about([0-9]*).html&view=newest viewtopic.php?t=$1&view=newest
[L,NC]
RewriteRule ^about([0-9]*)-([0-9]*)-([a-zA-Z]*)-([0-9]*).* viewtopic.php?t=$1&postdays=$2&postorder=$3&start=$4
[L,NC]
RewriteRule ^about([0-9]*)-([0-9]*).* viewtopic.php?t=$1&start=$2
[L,NC]
RewriteRule ^about([0-9]*).* viewtopic.php?t=$1 [L,NC]
RewriteRule ^about([0-9]*).html viewtopic.php?t=$1&start=$2&postdays=$3&postorder=$4&highlight=$5
[L,NC]
RewriteRule ^mark-forum([0-9]*).html* viewforum.php?f=$1&mark=topics
[L,NC]
RewriteRule ^updates-topic([0-9]*).html* viewtopic.php?t=$1&watch=topic
[L,NC]
RewriteRule ^stop-updates-topic([0-9]*).html* viewtopic.php?t=$1&unwatch=topic
[L,NC]
RewriteRule ^forum-([0-9]*).html viewforum.php?f=$1 [L,NC]
RewriteRule ^forum-([0-9]*).* viewforum.php?f=$1 [L,NC]
RewriteRule ^topic-([0-9]*)-([0-9]*)-([0-9]*).* viewforum.php?f=$1&topicdays=$2&start=$3
[L,NC]
RewriteRule ^ptopic([0-9]*).* viewtopic.php?t=$1&view=previous
[L,NC]
RewriteRule ^ntopic([0-9]*).* viewtopic.php?t=$1&view=next [L,NC]
#
#-----[ OPEN the following file and add the lines]------------------------------------------
#
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 the followin file]------------------------------------------
#
includes/functions.php
#
#-----[ FIND the following lines]------------------------------------------
#
if (!empty($db))
{
$db->sql_close();
}
#
#-----[ AFTER the lines, ADD ]------------------------------------------
#
if ( !$userdata['session_logged_in'] )
{
if (stristr($url, 'http://')) {
header('Location: ' . $url);
exit;
}
}
#-----[ OPEN the following file]------------------------------------------#
templates/subSilver/overall_footer.tpl
#-----[ FIND the following lines]------------------------------------------#
Powered by <a href="http://www.phpbb.com/" target="_phpbb"
class="copyright">phpBB</a>
#-----[ BEFORE, ADD ]------------------------------------#
<a href="http://www.phpbb4you.com/" target="_blank"
class="copyright">phpBB4you</a>
#-----[ SAVE/CLOSE ALL FILES & Upload all changed files to
your server. ]----#
|