Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

GForum Tip: Search Engine friendly templates

Quote Reply
GForum Tip: Search Engine friendly templates
For those of you using search_engine templates to make URL's look as static pages to search engines. I recently discovered a nice tip.

Google limit for indexing URL's is 128 chars. Categories with long names, plus long post descriptions will make google miss some pages from the indexing run when spidering your forums.

Solution? omit the name of the category from the URL and just leave forum name and post subject. Where? in the cat_path global.

Last edited by:

jaltuve: Aug 5, 2004, 1:42 PM
Quote Reply
Re: [jaltuve] GForum Tip: Search Engine friendly templates In reply to
Cool suggestion :)

Another one.. may be to add something like;

my $new_title = substr($value, $offset, '100');

..or similar.

Obviously it would need to be changed to suite the template... but the idea for the global is there :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [jaltuve] GForum Tip: Search Engine friendly templates In reply to
Can you detail that, please?
Quote Reply
Re: [webslicer] GForum Tip: Search Engine friendly templates In reply to
Hi Webslicer.

Check the URL's on your GForum instalation. If you use the search engine templates (which I'm sure you use) you will notice what this is all about.

I just checked the forums located at the bottom of your instalation. One is called off-topic, the other comments and suggestions. Check the URL's that link to them.

A search friendly URL has the standard form:

URL/xxxx_C/xxxxx_F/xxxxxx_P

See the C, F, P? That's Category, Forum and Post. what is in the X's is completely irrelevant. The apache Rewrite rules will ignore them and simply take the _C, _F or _P and the number following them. So for example a URL like:

http://www.xxxxx.com/forum/Psksk-Snew.comThisistoolongandmaybegooglewillskipme_C2/Questions_F3/

Simply means go to category ID 2 Forum ID 3. In order to SIMPLIFY IT and make it shorter, what I suggested is to simply leave the category X's fields blank by changing a global. The above URL with the change I proposed will look like:

http://www.xxxxx.com/forum/_C2/Questions_F3/

Why is this better? because the google search engine
has a limit for URL's longer than 128 chars. If their robot finds a link with a super long URL (over 128 chars) the spider will NOT, I repeat, will NOT index that URL. It is very common to have very long URL's in Gforum instalations with many categories and subcategories, but it is the Forum name and post subject the ones really relevant (in the URL) for a search engine.

Last edited by:

jaltuve: Aug 8, 2004, 1:59 AM
Quote Reply
Re: [jaltuve] GForum Tip: Search Engine friendly templates In reply to
In Reply To:

Simply means go to category ID 2 Forum ID 3. In order to SIMPLIFY IT and make it shorter, what I suggested is to simply leave the category X's fields blank by changing a global. The above URL with the change I proposed will look like:

http://www.xxxxx.com/forum/_C2/Questions_F3/

Why is this better? because the google search engine
has a limit for URL's longer than 128 chars. If their robot finds a link with a super long URL (over 128 chars) the spider will NOT, I repeat, will NOT index that URL. It is very common to have very long URL's in Gforum instalations with many categories and subcategories, but it is the Forum name and post subject the ones really relevant (in the URL) for a search engine.
You could shorten it even more by leaving off the category and/or forum altogether:

http://www.xxxxx.com/forum/Questions_F3/
http://www.xxxxx.com/forum/How_Do_I_Post_P1234/

It'll still work fine; the rewrite rules look for _Pxxx, then _Fxxx, then _Cxxx, in that order. The _C's and _F don't have to be there in order for _Pxxx to work.

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com

Last edited by:

Jagerman: Aug 12, 2004, 12:18 PM
Quote Reply
Re: [Jagerman] GForum Tip: Search Engine friendly templates In reply to
Hi, Jagerman;

Thanks for your expanded reply, that would be excellent, as shorter is better.

So, to do this, I simply edit the forum templates? Which ones are need to be modified, exactly?


The only other thing I would like to accomplish is to have the path not need the /forum/ portion.
Do you have an idea on that? I've tried different rewite rules to no luck so far on wiping out the subdirectory necessity.
Quote Reply
Re: [webslicer] GForum Tip: Search Engine friendly templates In reply to
You'll need to edit a few things:

search_engine globals:
- modify cat_full_name_linked commenting out this part near the bottom (additions are marked in ):

Code:
# for (@cats) {
# $cat_name = sprintf($category, ${$cat_path->($_->{cat_id})}, $_->{cat_name}) . $sep . $cat_name;
# }
- the cat_path global has a similar loop near the bottom that should be commented out:
Code:
# for (@cats) {
# ($cat_name_e = $_->{cat_name}) =~ y/ \t\r\n?"'#/__/d;
# $cat_name = sprintf($category, $cat_name_e, $_->{cat_id}) . $cat_name;
# }

I started going through include_paging.html, and discovered there are quite a few places that need to be updated to shorten them all. Basically, you want to look for any URL looking like <%cat_path($cat_id)%><%escape_name($forum_name)_F<%forum_id%>/<%escape_name($root_post_subject)%>_P<%root_post_id%>

and replace everything up to <%escape_name($root_post_subject)%> with /forum/, so that that above URL would look something like:

/forum/<%escape_name($root_post_subject)%>_P<%root_post_id%>

Keep in mind that you only want to do this for search_engine URL's containing a subject; I count 7, on lines: 27, 28, 41, 53, 65, 78, 79. To make this a little easier, I've attached a version of include_paging.html to this post with the substitutions - if you are using somewhere other than /forum/, I've added a line near the top: <%set search_engine_path = '/forum'%>, that you can change to whatever path you are using.

Those should get most, if not all, of the URL's sufficiently shortened. Another possible change you could make is to change the escape_name global, adding the following just before the line '$name = $IN->escape($name);':

substr($name, 80) = '...' if length $name > 80;

That should ensure that forum names and post subjects don't take more than 80 characters.



In Reply To:
The only other thing I would like to accomplish is to have the path not need the /forum/ portion

Are you having a problem getting the rewrite rules to work properly, or getting GForum to stop producing /forum/ for the URL's? In my attached file, changing '/forum' in the <%set ...%> to '' will do the trick for that file, changing the two globals mentioned above to use / instead of /forum should pretty much fix up the rest of it.


Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [jaltuve] GForum Tip: Search Engine friendly templates In reply to
Hi

Quote:
See the C, F, P? That's Category, Forum and Post. what is in the X's is completely irrelevant. The apache Rewrite rules will ignore them and simply take the _C, _F or _P and the number following them. So for example a URL like:

I was always made to understand that Google Loves URL's where something in Tilte is also there in the URL (could be that i am not upto date with current information). Now if "What Is in X" is irrelevant (or has become irrelevant), then part of the rewriting rules so far implemented for the forum become irrelevant too. If that be so then kindly do a count on following url and check the PR of the same...

http://gossamer-threads.com/...Globals_F30/GMail.pm

There would be many more of such url's, so does it mean that some time down the line all such pages are knocked off from Google's Index?

Additionally, On this forum, all that i see is "Non Search Engine Friendly" template. Is it that rewrite rules add quite a burden on server. For example normal access page loading time is about 0.14 secs (at low end of the page) and .28secs for static url (mod_rewrite) route?

HyTC.

Last edited by:

HyperTherm: Aug 19, 2004, 7:44 PM
Quote Reply
Re: [HyperTherm] GForum Tip: Search Engine friendly templates In reply to
If the URL above appears broken then check the following:

http://gossamer-threads.com/..._a_constant_P257143/

or perhaps the following if the above is just on the boundary line:

http://www.gossamer-threads.com/...ubscript_-1_P259311/
and Google Search for the above thread

Or Many Such Threads by accessing the forum from:

http://gossamer-threads.com/forum/ (the search engine friendly version url)


HyTC

Last edited by:

HyperTherm: Aug 19, 2004, 8:12 PM