Aquí está el código completo y todos los archivos que se necesitan para ser editados para mod_rewrite para foros phpBB
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;
}
}
- 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;
- }
- }
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;
}
- 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;
- }
.htaccess (Should be in forum root)
#
#-----[ ADD ]------------------------------------------
#
RewriteEngine On
RewriteRule ^forums.* index.php [L,NC]
RewriteRule ^post-([0-9]*).html&highlight=([a-zA-Z0-9]*) sutra.html&highlight= [L,NC]
RewriteRule ^post-([0-9]*).* sutra.html [L,NC]
RewriteRule ^view-poll([0-9]*)-([0-9]*)-([a-zA-Z]*).* ftopic.html&postdays=&postorder=&vote=viewresult [L,NC]
RewriteRule ^about([0-9]*).html&highlight=([a-zA-Z0-9]*) ftopic.html&highlight= [L,NC]
RewriteRule ^about([0-9]*).html&view=newest ftopic.html&view=newest [L,NC]
RewriteRule ^about([0-9]*)-([0-9]*)-([a-zA-Z]*)-([0-9]*).* ftopic.html&postdays=&postorder=&start= [L,NC]
RewriteRule ^about([0-9]*)-([0-9]*).* ftopic.html&start= [L,NC]
RewriteRule ^about([0-9]*).* ftopic.html [L,NC]
RewriteRule ^about([0-9]*).html ftopic.html&start=&postdays=&postorder=&highlight= [L,NC]
RewriteRule ^mark-forum([0-9]*).html* forum.html&mark=topics [L,NC]
RewriteRule ^updates-topic([0-9]*).html* ftopic.html&watch=topic [L,NC]
RewriteRule ^stop-updates-topic([0-9]*).html* ftopic.html&unwatch=topic [L,NC]
RewriteRule ^forum-([0-9]*).html forum.html [L,NC]
RewriteRule ^forum-([0-9]*).* forum.html [L,NC]
RewriteRule ^topic-([0-9]*)-([0-9]*)-([0-9]*).* forum.html&topicdays=&start= [L,NC]
RewriteRule ^ptopic([0-9]*).* ftopic.html&view=previous [L,NC]
RewriteRule ^ntopic([0-9]*).* ftopic.html&view=next [L,NC]
- .htaccess (Should be in forum root)
- #
- #-----[ ADD ]------------------------------------------
- #
- RewriteEngine On
- RewriteRule ^forums.* index.php [L,NC]
- RewriteRule ^post-([0-9]*).html&highlight=([a-zA-Z0-9]*) sutra.html&highlight= [L,NC]
- RewriteRule ^post-([0-9]*).* sutra.html [L,NC]
- RewriteRule ^view-poll([0-9]*)-([0-9]*)-([a-zA-Z]*).* ftopic.html&postdays=&postorder=&vote=viewresult [L,NC]
- RewriteRule ^about([0-9]*).html&highlight=([a-zA-Z0-9]*) ftopic.html&highlight= [L,NC]
- RewriteRule ^about([0-9]*).html&view=newest ftopic.html&view=newest [L,NC]
- RewriteRule ^about([0-9]*)-([0-9]*)-([a-zA-Z]*)-([0-9]*).* ftopic.html&postdays=&postorder=&start= [L,NC]
- RewriteRule ^about([0-9]*)-([0-9]*).* ftopic.html&start= [L,NC]
- RewriteRule ^about([0-9]*).* ftopic.html [L,NC]
- RewriteRule ^about([0-9]*).html ftopic.html&start=&postdays=&postorder=&highlight= [L,NC]
- RewriteRule ^mark-forum([0-9]*).html* forum.html&mark=topics [L,NC]
- RewriteRule ^updates-topic([0-9]*).html* ftopic.html&watch=topic [L,NC]
- RewriteRule ^stop-updates-topic([0-9]*).html* ftopic.html&unwatch=topic [L,NC]
- RewriteRule ^forum-([0-9]*).html forum.html [L,NC]
- RewriteRule ^forum-([0-9]*).* forum.html [L,NC]
- RewriteRule ^topic-([0-9]*)-([0-9]*)-([0-9]*).* forum.html&topicdays=&start= [L,NC]
- RewriteRule ^ptopic([0-9]*).* ftopic.html&view=previous [L,NC]
- RewriteRule ^ntopic([0-9]*).* ftopic.html&view=next [L,NC]
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$
- 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$
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;
}
}
- 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
- #
- #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
- #
- # EoM
©
http://www.able2know.com