you can do the rewrite only for bots
#
#-----[ OPEN ]------------------------------------------
#
includes/page_header.php
#
#-----[ FIND ]------------------------------------------
#
function rewrite_urls($content)
{
global $config_mg;
function if_query($amp)
#
#-----[ REPLACE, WITH ]------------------------------------------
#
function rewrite_urls($content)
{
global $config_mg;
if((eregi("bot", getenv("HTTP_USER_AGENT"))) or (ereg("Google", getenv("HTTP_USER_AGENT"))) or (ereg("Slurp", getenv("HTTP_USER_AGENT"))) or (ereg("Scooter", getenv("HTTP_USER_AGENT"))) or (eregi("Spider", getenv("HTTP_USER_AGENT"))) or (eregi("Infoseek", getenv("HTTP_USER_AGENT"))))
{
//
// Begin keyword urls mod
//
function if_query($amp)
#
#-----[ FIND ]------------------------------------------
#
if ( isset($config_mg['url_rw']) && ($config_mg['url_rw'] === '1') )
{
$content = preg_replace($url_in, $url_out, $content);
}
return $content;
#
#-----[ REPLACE, WITH ]------------------------------------------
#
if ( isset($config_mg['url_rw']) && ($config_mg['url_rw'] === '1') )
{
$content = preg_replace($url_in, $url_out, $content);
}
}
return $content;
#
#-----[ OPEN ]------------------------------------------
#
includes/page_tail.php
#
#-----[ FIND ]------------------------------------------
#
// begin keyword urls mod
//
if( function_exists(ob_gzhandler) && $board_config['gzip_compress'] == 1)
{
$gzip_contents = rewrite_urls(ob_get_contents());
ob_end_clean();
ob_start('ob_gzhandler');
echo $gzip_contents;
ob_end_flush();
}
else
{
$contents = rewrite_urls(ob_get_contents());
ob_end_clean();
echo $contents;
global $dbg_starttime;
}
//
// end keyword urls mod
//
#
#-----[ REPLACE, WITH ]------------------------------------------
#
if((eregi("bot", getenv("HTTP_USER_AGENT"))) or (ereg("Google", getenv("HTTP_USER_AGENT"))) or (ereg("Slurp", getenv("HTTP_USER_AGENT"))) or (ereg("Scooter", getenv("HTTP_USER_AGENT"))) or (eregi("Spider", getenv("HTTP_USER_AGENT"))) or (eregi("Infoseek", getenv("HTTP_USER_AGENT"))))
{
// begin keyword urls mod
//
if( function_exists(ob_gzhandler) && $board_config['gzip_compress'] == 1)
{
$gzip_contents = rewrite_urls(ob_get_contents());
ob_end_clean();
ob_start('ob_gzhandler');
echo $gzip_contents;
ob_end_flush();
}
else
{
$contents = rewrite_urls(ob_get_contents());
ob_end_clean();
echo $contents;
global $dbg_starttime;
}
//
// end keyword urls mod
//
}
#-----[ OPEN ]------------------------------------------
#
includes/page_header.php
#
#-----[ FIND ]------------------------------------------
#
function rewrite_urls($content)
{
global $config_mg;
function if_query($amp)
#
#-----[ REPLACE, WITH ]------------------------------------------
#
function rewrite_urls($content)
{
global $config_mg;
if((eregi("bot", getenv("HTTP_USER_AGENT"))) or (ereg("Google", getenv("HTTP_USER_AGENT"))) or (ereg("Slurp", getenv("HTTP_USER_AGENT"))) or (ereg("Scooter", getenv("HTTP_USER_AGENT"))) or (eregi("Spider", getenv("HTTP_USER_AGENT"))) or (eregi("Infoseek", getenv("HTTP_USER_AGENT"))))
{
//
// Begin keyword urls mod
//
function if_query($amp)
#
#-----[ FIND ]------------------------------------------
#
if ( isset($config_mg['url_rw']) && ($config_mg['url_rw'] === '1') )
{
$content = preg_replace($url_in, $url_out, $content);
}
return $content;
#
#-----[ REPLACE, WITH ]------------------------------------------
#
if ( isset($config_mg['url_rw']) && ($config_mg['url_rw'] === '1') )
{
$content = preg_replace($url_in, $url_out, $content);
}
}
return $content;
#
#-----[ OPEN ]------------------------------------------
#
includes/page_tail.php
#
#-----[ FIND ]------------------------------------------
#
// begin keyword urls mod
//
if( function_exists(ob_gzhandler) && $board_config['gzip_compress'] == 1)
{
$gzip_contents = rewrite_urls(ob_get_contents());
ob_end_clean();
ob_start('ob_gzhandler');
echo $gzip_contents;
ob_end_flush();
}
else
{
$contents = rewrite_urls(ob_get_contents());
ob_end_clean();
echo $contents;
global $dbg_starttime;
}
//
// end keyword urls mod
//
#
#-----[ REPLACE, WITH ]------------------------------------------
#
if((eregi("bot", getenv("HTTP_USER_AGENT"))) or (ereg("Google", getenv("HTTP_USER_AGENT"))) or (ereg("Slurp", getenv("HTTP_USER_AGENT"))) or (ereg("Scooter", getenv("HTTP_USER_AGENT"))) or (eregi("Spider", getenv("HTTP_USER_AGENT"))) or (eregi("Infoseek", getenv("HTTP_USER_AGENT"))))
{
// begin keyword urls mod
//
if( function_exists(ob_gzhandler) && $board_config['gzip_compress'] == 1)
{
$gzip_contents = rewrite_urls(ob_get_contents());
ob_end_clean();
ob_start('ob_gzhandler');
echo $gzip_contents;
ob_end_flush();
}
else
{
$contents = rewrite_urls(ob_get_contents());
ob_end_clean();
echo $contents;
global $dbg_starttime;
}
//
// end keyword urls mod
//
}