hey Craven i have got a problem with google i have only 37 pages indexed only some of my topics are indexed ( ~4) the other are repetitive access to login.php..
can you resolve it ?
I use those URL rewrinting:
Code:#
#-----[ OUVRIR ]---------------------------------------------
#
includes/sessions.php
#
#-----[ TROUVER ]---------------------------------------------
# vers la ligne 139
$sql = "UPDATE " . SESSIONS_TABLE . "
SET session_user_id = $user_id, session_start = $current_time, session_time = $current_time, session_page = $page_id, session_logged_in = $login
WHERE session_id = '" . $session_id . "'
AND session_ip = '$user_ip'";
#
#-----[ REMPLACER PAR ]---------------------------------------
#
$sql_ip = $user_id == ANONYMOUS ? " AND session_ip = '$user_ip'" : '';
$sql = "UPDATE " . SESSIONS_TABLE . "
SET session_ip = '$user_ip', session_start = $current_time, session_time = $current_time, session_page = $page_id, session_logged_in = $login
WHERE session_id = '" . $session_id . "' $sql_ip
AND session_user_id = '$user_id'";
#
#-----[ TROUVER ]---------------------------------------------
# vers la ligne 186
$SID = 'sid=' . $session_id;
#
#-----[ REMPLACER PAR ]---------------------------------------
#
$SID = $user_id > 0 ? 'sid=' . $session_id : '';
#
#-----[ TROUVER ]---------------------------------------------
# vers la ligne 256
$SID = ($sessionmethod == SESSION_METHOD_GET || defined('IN_ADMIN')) ? 'sid=' . $session_id : '';
#
#-----[ REMPLACER PAR ]---------------------------------------
#
$SID = $userdata['user_id'] > 0 ? (($sessionmethod == SESSION_METHOD_GET || defined('IN_ADMIN')) ? 'sid=' . $session_id : '') : '';
#
#-----[ TROUVER ]---------------------------------------------
# vers la ligne 303
//
// If we reach here then no (valid) session exists. So we'll create a new one,
#
#-----[ AVANT, AJOUTER ]---------------------------------------
#
elseif(empty($sessiondata))
{
// try to login guest
$sql = "SELECT u.*, s.*
FROM " . SESSIONS_TABLE . " s, " . USERS_TABLE . " u
WHERE s.session_ip = '$user_ip'
AND s.session_user_id = " . ANONYMOUS . "
AND u.user_id = s.session_user_id
LIMIT 0, 1";
if ( !($result = $db->sql_query($sql)) )
{
message_die(CRITICAL_ERROR, 'Error doing DB query userdata row fetch', '', __LINE__, __FILE__, $sql);
}
$userdata = $db->sql_fetchrow($result);
if ( isset($userdata['user_id']) )
{
if ( $current_time - $userdata['session_time'] > 60 )
{
$sql = "UPDATE " . SESSIONS_TABLE . "
SET session_time = $current_time, session_start = $current_time, session_page = 0
WHERE session_id = '" . $userdata['session_id'] . "'";
if ( !$db->sql_query($sql) )
{
message_die(CRITICAL_ERROR, 'Error updating sessions table', '', __LINE__, __FILE__, $sql);
}
}
return $userdata;
}
}
Code:#
#-----[ OUVRIR ]------------------------------------------
#
includes/page_header.php
#
#-----[ TROUVER ]------------------------------------------
#
#
$template->set_filenames(array(
'overall_header' => ( empty($gen_simple_header) ) ? 'overall_header.tpl' : 'simple_header.tpl')
);
#
#-----[ APRES, AJOUTER ]------------------------------------------
#
ob_start();
function replace_mod_rewrite($s)
{
$urlin = array(
"'(?<!/)viewforum.php\?f=([0-9]*)&topicdays=([0-9]*)&start=([0-9]*)'",
"'(?<!/)viewforum.php\?f=([0-9]*)&mark=topics'",
"'(?<!/)viewforum.php\?f=([0-9]*)'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&view=previous'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&view=next'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&view=newest'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&(?:amp;)watch=topic&(?:amp;)start=([0-9]*)'",
"'(?<!/)viewtopic.php\?t=([0-9]*)&(?:amp;)unwatch=topic&(?:amp;)start=([0-9]*)'",
"'(?<!/)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]*)&highlight=([a-zA-Z0-9]*)'",
"'(?<!/)viewtopic.php\?t=([0-9]*)'",
"'(?<!/)viewtopic.php\?p=([0-9]*)'");
$urlout = array(
"viewforum\\1-\\2-\\3.php",
"mforum\\1.php",
"forum\\1.php",
"ptopic\\1.php",
"ntopic\\1.php",
"newtopic\\1.php",
"stopic\\1-\\2.php",
"utopic\\1-\\2.php",
"ftopic\\1-\\2-\\3-\\4.php",
"ftopic\\1-\\2-\\3-\\4-\\5.php",
"ftopic\\1-\\2.php",
"setopic_\\1-\\2.html",
"ftopic\\1.php",
"sutra\\1.php");
$s = preg_replace($urlin, $urlout, $s);
return $s;
}
#
#-----[ OUVRIR ]------------------------------------------
#
includes/page_tail.php
#
#-----[ TROUVER ]------------------------------------------
#
$db->sql_close();
#
#-----[ APRES, AJOUTER ]------------------------------------------
#
$contents = ob_get_contents();
ob_end_clean();
echo replace_mod_rewrite($contents);
global $dbg_starttime;
#
#-----[ TROUVER ]------------------------------------------
#
$gzip_contents = ob_get_contents();
ob_end_clean();
#
#-----[ APRES, AJOUTER ]------------------------------------------
#
echo replace_mod_rewrite($contents);
global $dbg_starttime;
Code:
and this .htaccess
RewriteEngine On
RewriteRule ^forums.* /index.php
RewriteRule ^mforum([0-9]*).* /viewforum.php?f=$1&mark=topics
RewriteRule ^viewforum([0-9]*)-([0-9]*)-([0-9]*).* /viewforum.php?f=$1&topicdays=$2&start=$3
RewriteRule ^forum([0-9]*).* /viewforum.php?f=$1
RewriteRule ^ptopic([0-9]*).* /viewtopic.php?t=$1&view=previous
RewriteRule ^ntopic([0-9]*).* /viewtopic.php?t=$1&view=next
RewriteRule ^stopic([0-9]*)-([0-9]*).* /viewtopic.php?t=$1&watch=topic&start=$2
RewriteRule ^utopic([0-9]*)-([0-9]*).* /viewtopic.php?t=$1&unwatch=topic&start=$2
RewriteRule ^ftopic([0-9]*)-([0-9]*)-([a-zA-Z]*)-([0-9]*).* /viewtopic.php?t=$1&postdays=$2&postorder=$3&start=$4
RewriteRule ^ftopic([0-9]*)-([0-9]*).* /viewtopic.php?t=$1&start=$2
RewriteRule ^ftopic([0-9]*).* /viewtopic.php?t=$1
RewriteRule ^ftopic([0-9]*).html /viewtopic.php?t=$1&start=$2&postdays=$3&postorder=$4&highlight=$5
RewriteRule ^setopic_([0-9]*)-([a-zA-Z0-9]*).* /viewtopic.php?t=$1&start=$2
RewriteRule ^sutra([0-9]*).* /viewtopic.php?p=$1
RewriteRule ^newtopic([0-9]*).* /viewtopic.php?t=$1&view=newest