Page 1 of 1

not sure its SE friendly

Posted: Thu Mar 16, 2006 12:53 am
by mandarin
I am getting session ids in the forum indexpage when logged out. Thats not a good thing for the search engines. Use the code below to remove session ids for bots:

Code: Select all

#-----[ OPEN ]------------------------------------------
#
includes/sessions.php

#
#-----[ FIND ]------------------------------------------
#
        //
        // Does a session exist?
        //

#
#-----[ BEFORE, ADD ]------------------------------------------
#
    $user_id = ( isset($sessiondata['userid']) ) ? intval($sessiondata['userid']) : ANONYMOUS;

    if($user_id != ANONYMOUS)
    {

#
#-----[ FIND ]------------------------------------------
#
return $userdata;

#
#-----[ BEFORE, ADD ]------------------------------------------
#

    }
    else
    {
       $userdata['session_id'] = '';
       $userdata['session_ip'] = '';
       $userdata['session_user_id'] = $user_id;
       $userdata['session_logged_in'] = 0;
       $userdata['session_page'] = '';
       $userdata['session_start'] = '';
       $userdata['session_time'] = '';

    }

#
#-----[ FIND AND DELETE ]------------------------------------------
#

       // If we reach here then no (valid) session exists. So we'll create a new one,
       // using the cookie user_id if available to pull basic user prefs.
       //
       $user_id = ( isset($sessiondata['userid']) ) ? intval($sessiondata['userid']) : ANONYMOUS;


#
#-----[ FIND ]------------------------------------------
#
        //
        // Delete existing session
        //

#
#-----[ BEFORE, ADD ]------------------------------------------
#
    if(isset($session_id))
    {


#
#-----[ FIND ]------------------------------------------
#
        setcookie($cookiename . '_data', '', $current_time - 31536000, $cookiepath, $cookiedomain, $cookiesecure);
        setcookie($cookiename . '_sid', '', $current_time - 31536000, $cookiepath, $cookiedomain, $cookiesecure);
#
#-----[ AFTER, ADD ]------------------------------------------
#

    }
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
[/code]

Re: not sure its SE friendly

Posted: Thu Mar 16, 2006 2:59 am
by coop99
mandarin wrote:I am getting session ids in the forum indexpage when logged out. Thats not a good thing for the search engines. Use the code below to remove session ids for bots:
No need! The SE's (especially Google) love the url structure and rank nearly all of the threads and posts highly based on keywords in the title.

Go ahead and look at the 5th result down out of 74,600,000

http://www.google.com/search?hl=en&lr=& ... tools+list

The url structure has no session IDs in search results that I have seen.

Posted: Thu Aug 10, 2006 5:44 am
by overdriveelectronics
Yeah I have seen the pages get good rankings, its nice to see from a traffic generation standpoint!

search engine friendly urls

Posted: Thu Oct 19, 2006 8:21 pm
by shaggy35
I use a great product call ISAPI-rewrite. Basically it rewrites your urls on the fly using Regular Expressions (its a windows version of what mod rewrite does on apache). Basically, you can create full on database driven websites without any ? etc. Works great

Shaggy