Forum Moderators: phranque

Message Too Old, No Replies

PhpBB 2.04 + Google indexing

How the heck can you set up phpbb 2.04 to be properly indexed by google?

         

hbirnbaum

11:37 pm on Apr 18, 2003 (gmt 0)

10+ Year Member



Hello all. I have been spinning my wheels over and over again regarding setting up my phpbb forum to be properly indexed by google.

There is a thread on phpbb community that runs well over 20 pages discussing this topic, and is very old. An answer is not clear at all even though a lot of people have been asking. There seems to be a lot of speculation and suggestions, but no solid code for PhpBB 2.04. Apparently the mod there was written for an earlier version.

Also, there have been some threads in the past here on webmasterworld regarding flat urls, and removing sessions id's, but nothing recent, and no solid answer. Also, no links that I could find for creating flat urls. I also heard some talk about cloaking to solve this problem?

I know a lot of people have been asking this question all over the place, so I thought I would start a new thread in the hopes that someone can provide some solid answers to this old dilemma. How the heck do you optimize PhpBB 2.04 to index properly w. google? Does anyone have code that works for this, or a URL for a mod that actually functions w/ the latest version?

Any help in this would be greatly appreciated! I have about 8000 messages, and 100's of threads that are relevant to my site, and I would like all these topics\threads indexed in google. There has got to be a way to do this, but since I am not a PHP expert, I am somewhat in the dark. Can someone help?

EliteWeb

11:41 pm on Apr 18, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Your answer is found in a thread made available on the PHPBB community forum. It involves changing a chunck of code which is perfectly described in the article. it is just one of the pages in the PHPBB directory. PHPBB 2.0.4 & Google [phpbb.com].

I myself have implimented this code in all of my phpBB sites and it has been proven to work flawlessly!

BGumble

11:44 pm on Apr 18, 2003 (gmt 0)

10+ Year Member



Ignore my sticky, hbirnbaum, there is your answer.

hbirnbaum

12:11 am on Apr 19, 2003 (gmt 0)

10+ Year Member



Thank you for pointing me to that thread. I have entered the following code into sessions.php

This is a followup to the original post, and works w/o causing errors
-----------------------------------------------------
global $SID, $HTTP_SERVER_VARS;
if (!empty($SID) &&!preg_match('#sid=#', $url) &&!strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'Googlebot') &&!strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'slurp@inktomi.com;'))
-----------------------------------------------------

This is the original code that causes 2 fatal errors when attempting to view the forum
#-----[ OPEN  ]------------------------------------------
includes/sessions.php
#-----[ FIND ]------------------------------------------
   global $SID;
   if (!empty($SID) &&!preg_match('#sid=#', $url) )
#-----[ REPLACE WITH ]------------------------------------------
   global $SID, $HTTP_SERVER_VARS;
   if (!empty($SID) &&!preg_match('#sid=#', $url) &&!strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'Googlebot') &&!strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'slurp@inktomi.com;'))
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM

I got errors when viewing the forum using this code.

Will the code that I added work (the first one seems just a little different, but doesn't cause an error like the latter)? Is this right?

Auradefect

1:21 am on Apr 19, 2003 (gmt 0)

10+ Year Member



Nice thread, because i was going to start one similar to this.

I am planning on starting a forum within the next week. Which forum should i get that google will have no problems with. I have seen many free ones and i would prefer it would be one of them. I just want to make sure google and other SE's will love it.

Also, anyone know any good links that will give me tips about starting a forum and getting it successful?

EliteWeb

7:32 am on Apr 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Auradefect, each discussion forum software all seems to have threads on making it so search engines index them so no matter what software you use check for the functionality of it being indexed.

As far as hbirnbaums' code post, what I can recommend is to post a reply to the thread previously mentioned for the phpBB discussion on google indexability. My code I used, I followed the directions on the site and I had no errors. I see your running Windows w/ php and that I haven't dealt with so I don't know if there are any differences between the php for UNIX but that may be the case or just upgrade/installation issues. Also try this thread on google +phpBB2.0.4 [phpbb.com]

Yidaki

9:19 am on Apr 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



hrbirnbaum,

that's the modded session.php code that i use with my phpbb v. 2.0.3. It should also work with 2.0.4. Just replace the last function (append_sid) with by code:

-----------------------------------
function append_sid($url, $non_html_amp = false)
{
global $SID, $HTTP_SERVER_VARS;

if (!empty($SID) &&!eregi('sid=', $url) &&!strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'Googlebot') &&!strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'FAST-WebCrawler') &&!strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'Slurp@inktomi') &&!strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'Scooter') &&!strstr($HTTP_SERVER_VARS['HTTP_USER_AGENT'] ,'Firefly'))
{
$url .= ( ( strpos($url, '?')!= false )? ( ( $non_html_amp )? '&' : '&' ) : '?' ) . $SID;
}

return($url);
}
-----------------------------------

You can add more user agents and even ip's if you like.

If you copy code examples from the phpbb support forums and paste it into your php codes be carefull -> remove all possible spaces before each return / line feed! In my case the errors i had were a result of this spaces.

HTH

hbirnbaum

4:33 am on Apr 20, 2003 (gmt 0)

10+ Year Member



First of all, thank you so much for assisiting me with this problem. You guys have been a huge help, I really appreciate it!

EliteWeb
I tried the code you were using, and it created errors. Not sure what the problem was, but the forum stopped running. I replaced it w/ the old code (pre-google) and it worked again.

Yidaki
I replaced the last function like you said. Forum seems to be working good; no visible errors. I didn't know that spaces were bad. I am really glad that you mentioned this. I have remvoed all trailing spaces from your code, and so far so good.

It looks like this mod is setup for several search engines besides google; good think. I can't wait for google to spider my forum. I think freshbot will goto town on it.

How high of a pr do I need for google to index the entire forum?

EliteWeb

5:33 am on Apr 20, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Ah yes forgot about the blank spaces good point Yidaki :D