READ THIS: Remove PHPSSID from URL (FOR SITEMAPS with TP support)

Started by Off Da HuyChoK, March 17, 2006, 01:57:01 AM

Previous topic - Next topic

Off Da HuyChoK

example.com/node?PHPSESSID=7dd1d5d1471fa8be2fea8f163cce3257 [nofollow]  >:( :'(

Tired of that ^^^^ ??

.. me too, i think I got it figured out below

       |
       |
    \  |  /
     \ | /
      \ /
[nofollow]
http://www.hyperky.com [nofollow]

Off Da HuyChoK

#1
OK I got it figured out..

http://www.hyperky.com/sitemaps.php [nofollow]
http://www.hyperky.com/urllist.php [nofollow]

I had to edit my .htaccess, modify the google sitemaps mod, and modify some of the SMF code.

Next stop, I will get this working with TP portal MOD!  8)


I will post the instructions here if requested.
[nofollow]
http://www.hyperky.com [nofollow]

vbgamer45

Post it please haven't really had time to really look into this yet.
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Off Da HuyChoK

#3
THIS IS WITH TP SUPPORT, IF YOU DONT HAVE TP THEN DONT MODIFY/ADD/OR REPLACE ANYTHING WITH THE WORD "ARTICLE" IN IT, then you should be ok  ;)


DISABLE FRIENDLY URLS FIRST, u wont need them any more  ;D

Add this to .htaccess :
=================
<IfModule mod_php4.c>
php_value session.use_trans_sid 0
</IfModule>

RewriteEngine On
RewriteBase /

RewriteRule ^index.html index.php [L]
RewriteRule ^board([0-9.]*).html index.php?board=$1.0 [L]
RewriteRule ^topic([0-9.]*).html index.php?topic=$1.0 [L]
RewriteRule ^article([0-9.]*).html index.php?page=$1 [L]
RewriteRule ^profile([0-9.]*).html index.php?action=profile;u=$1 [L]


sitemaps.php by Davilac [nofollow]
===================
FIND:
--------------------------------------------------------
   $members[] = array(
      'id' => $row['ID_MEMBER'],
      'times' => $member_post_times,
   );
}

mysql_free_result($request);
--------------------------------------------------------
ADD AFTER: -TP ONLY-
--------------------------------------------------------
$request = db_query("
   SELECT ID
   FROM {$db_prefix}tp_articles", __FILE__, __LINE__);
$articles = array();
while ($row = mysql_fetch_assoc($request))
{
   $articles[] = array(
      'id' => $row['ID'],
      );
}
mysql_free_result($request);
--------------------------------------------------------
FIND:
--------------------------------------------------------
// Popular topics too...
if ($modSettings['queryless_urls']==0){
--------------------------------------------------------
ADD BEFORE: -TP ONLY- lol  :D
--------------------------------------------------------
// The Articles (adds support for sitemaps in Tiny Portal)
foreach ($articles as $article)

   echo '
   <url>
      <loc>', $scripturl, "article", $article['id'], '.html</loc>
      <lastmod>', posts_max_time($board['times']), '</lastmod>
      <changefreq>daily</changefreq>
      <priority>', posts_to_priority(0.9, $board['times']), '</priority>
   </url>';
--------------------------------------------------------
FIND                     >>>       REPLACE WITH:  (EXACTLY AS BELOW, WITH QUOTES)
--------------------------------------------------------
$scripturl       ALL      >>>        "http://www.yoursite.com/YOURFORUM [nofollow]"
'?board='                  >>>        "board"
'/board,'                   >>>         "board"
'?topic='                   >>>         "topic"
'/topic,'                    >>>         "topic"
'?action=profile;u='     >>>         "profile"
], '.0          ALL          >>>         ], '.html
], '.0.html    ALL          >>>         ], '.html
$member['id'], '</loc>      >>>             $member['id'], '.html</loc>
---------------------------------------------------------

robots.txt
---------
User-agent: Googlebot
Disallow: /*PHPSESSID
Disallow: /*?

User-agent: *

Disallow: /data/
Disallow: /avatars/
Disallow: /attachments/
Disallow: /tp-downloads/
Disallow: /Packages/
Disallow: /Sources/
Disallow: /Themes/
Disallow: /Smileys/
Disallow: /wysiwyg/

Disallow: /Settings.php
Disallow: /Settings_bak.php
Disallow: /SSI.php
Disallow: /ssi_examples.shtml
Disallow: /ssi_examples.php
------------------------------



Sorry about the mess, im not good at writing guides, but ill try to revise when I have time.  This definetly works..

look at my sitemaps:

http://www.hyperky.com/sitemaps.php [nofollow]
http://www.hyperky.com/urllist.php [nofollow]

GOOD LUCK, ILL BE HELPING MORE TOMOROW!
[nofollow]
http://www.hyperky.com [nofollow]

sbarnes

Hi there,
I have followed all instructions to the letter except that I could not find any ], '.0.html in my file.

I am getting a load of notices on my generated page.

Please see: http://www.pick-your-brains.co.uk/sitemaps/index.php

Any idea how I can make this normal? or what the problem is? will it still work if submitted to google?

It is just the index.php which has these errors the others are fine.
http://www.pick-your-brains.co.uk/sitemaps/sitemaps.php
http://www.pick-your-brains.co.uk/sitemaps/urllist.php

Also the first edit:
Do you add that to the existing htaccess file in the sitemaps folder or replace it with?


sbarnes

Sorry I dont get what you are telling me.

Are you saying that the mod is interfering with the sitemap stuff?

How comes the link you supplied has session info?, links I see dont?

Stüldt Håjt

Im saying that this "Remove PHPSSID from URL" doesn't work as I see a session id in your forum.

sbarnes

oh right, thanks.
That is weird tho because I dont see links that, is this normal?

And why would this mod for sitemaps alter the working of the site.

All edited files are within the sitemaps folder. Am I missing something?


sbarnes

see, I dont get this.

If I goto http://www.pick-your-brains.co.uk/sitemaps/index.php.
and copy that link I get:
http://www.pick-your-brains.co.uk/index.php?topic=22.0

What does everyone get?

Also the first edit:
Do you add that to the existing htaccess file in the sitemaps folder or replace it with? is the htaccess in the sitemaps folder or the root?

Stüldt Håjt

Log out and delete your forums cookie from your browser and go to there again and you will see sessid.

But I don't think that is a problem with Google, because if you use Googlebot user agent you won't see sessids...

oSa

I've tried this method, my sitemap is errorfree but when i copy/paste the urls form the sitemap i get "page not found" errors. In the first post of this thread it says "DISABLE FRIENDLY URLS FIRST, u wont need them any more" but it doesn't seem to work with this option disabled. And i think my host doesn't support mod_rewrite so i can't enable it either. What should i do, just submit the sitemap with links like "http://osa.buildtolearn.net/forum/index.php?board=1.0" ?


Oldiesmann

Turning off the session.use_trans_sid option in php.ini will usually remove PHPSESSID from the URLs.

For those who don't have access to php.ini, either ask your host to do it (tell them that it's a security risk to have the session ID displayed in the URL like that) or use ini_set() to turn it off (add ini_set('session.use_trans_sid', 0); to the beginning of index.php). If your host has disabled ini_set, you should probably find a new host who knows what they're doing...

Also, enabling the session.use_only_cookies option can make things more secure as well...
Michael Eshom
Christian Metal Fans

Ben_S

If you are using 1.1 RC2 or later, SMF will not start session ID's for bots (code is in Load.php).
Liverpool FC Forum with 14 million+ posts.

Advertisement: