xoops forums

aproape

Just popping in
Posted on: 2007/11/2 17:03
aproape
aproape (Show more)
Just popping in
Posts: 19
Since: 2007/2/19
#1

SEO hack for CBB v3.08

Good morning everyone!

We have implemented a better SEO for newbb and thought anyone else might benefit for this change.

It's working [for us at least] much better than using just the Simplified URL's mapping - and it looks much nicer

The results:

www.yourwebsite.com/SEO_forums_name/t/xx/topic_title/

IMPORTANT: You need apache + mod_rewrite installed in order for this hack to work.

Also, if you have suin's Simplified URLs hack - you have to cancel the forums module by using the $cancel_module variable in simplified_url.php file.

$cancel_module = "newbb";

[unless you have other modules already canceled, at which point you use $cancel_module = "other_module | newbb | etc"].

Now, to be a bit more descriptive:

1. SEO_forums_name => you define it. Can be anything, really.

2. /t/xx/ => identifier for the topic id. It will be created automatically by CBB when you make a new topic [/t/23/, /t/42/ and so on].

3. topic_title => the exact title of the topic - with dashes.

To give a real example, this particular topic [I am writing], would be:

https://xoops.org/forums/t/61568/seo-hack-for-cbb-v3.08/

We have used part of the SEO generation code from SmartSection - to make things more portable and easier.

Currently we are running XOOPS v2.0.16 with simplified URLs hack - and this new one for CBB v3.08 - all running very smoothly

Installation:

Download the archive from:

SEO for CBB v3.08

Step 1:

Put the following two lines in .htaccess in the root of your XOOPS installation [BEFORE the simplified URLs lines!]

RewriteRule ^SEO_forums_name/([a-z]+)/([0-9]+)(/(.+))? modules/newbb/seo.php?seoOp=$1&seoArg=$2&seoOther=$4&%{QUERY_STRING} [L]
RewriteRule ^SEO_forums_name(/)? modules/newbb/?%{QUERY_STRING} [L]


[make sure you replace SEO_forums_name with anything else you want for your URL => forums, forum, veryniceforums, etc!]

[I included these two lines already in a text file in the archive - considering these forums are breaking up the lines].

The same variable name needs to be replaced inside the seo_url.php file => [look for SEO_MODULE_NAME on line 7].

Step 2:

Add seo.php and seo_url.php from the archive into /modules/newbb/ directory - where you installed CBB

Step 3:

Replace header.php with the one from the archive - inside /modules/newbb/ directory.

[make sure that any changes you did to header.php - if any - are still valid or moved to the new file].

I hope this hack will help more people and sites and.. who knows - maybe we will see the new CBB version with SEO fully enabled! *smile*


Here,
aproape

nachenko

Quite a regular
Posted on: 2007/11/2 17:15
nachenko
nachenko (Show more)
Quite a regular
Posts: 356
Since: 2005/1/18
#2

Re: SEO hack for CBB v3.08

Great!

suico

Friend of XOOPS
Posted on: 2007/11/2 19:19
suico
suico (Show more)
Friend of XOOPS
Posts: 374
Since: 2003/7/24
#3

Re: SEO hack for CBB v3.08

Great job, have you submitted it as a patch in sourceforge.net for the cbb developers to include this feature in their next release?

Thanks for sharing!
Yogurt Social Network Service
Visit: http://www.marcellobrandao.eti.br/

aproape

Just popping in
Posted on: 2007/11/2 19:36
aproape
aproape (Show more)
Just popping in
Posts: 19
Since: 2007/2/19
#4

Re: SEO hack for CBB v3.08

Heya suico,

Quote:

suico wrote:
Great job, have you submitted it as a patch in sourceforge.net for the cbb developers to include this feature in their next release?



Err - nope! I wasn't aware of that being in existence actually - and.. I will look into it. *smile*


Quote:

Thanks for sharing!


You're welcome!

I'd like to hear if anyone else has implemented it successfully and, by the way - I put there v3.08 however I am sure it can be back-ported to other versions as well - I just didn't tested with anything else.


Here,
aproape

mesol

Not too shy to talk
Posted on: 2007/11/3 0:41
mesol
mesol (Show more)
Not too shy to talk
Posts: 168
Since: 2006/4/19
#5

Re: SEO hack for CBB v3.08

With some modification, I think this hack can also be implemented in News module. If I have Simplified URs hack activate in my site, do I have to inactivate it first (by commenting require simplified.php; in mainfile.php) ?

by the way, i try for my newbb butthe url become like this

http://www.mydomain.com/forum/t/266//&forum=42

aproape

Just popping in
Posted on: 2007/11/3 2:53
aproape
aproape (Show more)
Just popping in
Posts: 19
Since: 2007/2/19
#6

Re: SEO hack for CBB v3.08

Hi there mesol!

Quote:

mesol wrote:
With some modification, I think this hack can also be implemented in News module.


Correct. We are not using News atm - only SmartSection - but the attached hack is pretty easy to adapt to other modules as well [most likely you have to re-write the .htaccess rules as well as the header.php [or equivalent] in the module itself and the list of files that are used to serve the content].

Quote:

If I have Simplified URs hack activate in my site, do I have to inactivate it first (by commenting require simplified.php; in mainfile.php) ?


My apologies - I forgot to mention that if you have simplified URLs - you have to cancel the forums module by using the $cancel_module variable in simplified_url.php file.

$cancel_module = "newbb";

[unless you have other modules already canceled] [I will add this to the original post and archive - just in case].

Quote:

by the way, i try for my newbb butthe url become like this

http://www.mydomain.com/forum/t/266//&forum=42


Try the above..

also - make sure ALL modifications are made - from the first post [you shouldn't have that empty string between /266//


Here,
aproape

yared

Just popping in
Posted on: 2007/11/3 3:36
yared
yared (Show more)
Just popping in
Posts: 14
Since: 2003/2/13
#7

Re: SEO hack for CBB v3.08

oh oh I =

Quote:
by the way, i try for my newbb butthe url become like this
http://www.mydomain.com/forum/t/266//&forum=42


.(

riceking

Just popping in
Posted on: 2007/11/3 4:54
riceking
riceking (Show more)
Just popping in
Posts: 16
Since: 2007/9/21
#8

Re: SEO hack for CBB v3.08

Maybe what you did is something creative.

But I don't understand why the hack is better than "Simplied URL", as you said.

Does google search engine prefer to get a '.htm' static page under a site's root path directly, or prefer to explode a site's layers to get a dynamic page?

aproape

Just popping in
Posted on: 2007/11/3 8:17
aproape
aproape (Show more)
Just popping in
Posts: 19
Since: 2007/2/19
#9

Re: SEO hack for CBB v3.08

Hi there riceking,

Quote:

riceking wrote:
Maybe what you did is something creative.

But I don't understand why the hack is better than "Simplied URL", as you said.

Does google search engine prefer to get a '.htm' static page under a site's root path directly, or prefer to explode a site's layers to get a dynamic page?


The main reason is the URL itself.

With Simplified URLs hack you get the /forum+topic+id.. etc

With the one we implemented - you no longer have the '+'s [which are a bit annoying by the way] and, most importantly, you have the topic title in the url which in turn does help with SEO.


Here,
aproape

riceking

Just popping in
Posted on: 2007/11/3 9:35
riceking
riceking (Show more)
Just popping in
Posts: 16
Since: 2007/9/21
#10

Re: SEO hack for CBB v3.08

Hello, aproape, thanks to your reply!
Quote:

most importantly, you have the topic title in the url which in turn does help with SEO.


However, I have 3 doubts:

1)Does the topic title in the url help with SEO?

2)If the topic title in the url helps with SEO, but the topic title is non-english(Chinese, for example), can it be written in URL?

3)If the CBB URL does not support non-english, is the hack still SEO?