Gossamer Forum
Home : Products : Gossamer Forum : Development, Plugins and Globals :

Search Engine Friendly Templates!

(Page 1 of 5)
> >
Quote Reply
Search Engine Friendly Templates!
Hi,

We've put together a set of template sets (well, 4 templates in total), that will allow you to present search engine friendly URL's! This will allow you to have your forum content archived by spiders, without having to go to the overhead of actually creating static html pages.

This requires mod_rewrite to work properly. You need to add the following rewrite rules to a .htaccess file or httpd.conf, and then add the attached templates to your templates directory.

RewriteRule ^/forum/.*P([0-9]+)/?$ /perl/gforum/gforum.cgi?post=$1&t=search_engine [L]
RewriteRule ^/forum/.*P([0-9]+)-([0-9]+)/?$ /perl/gforum/gforum.cgi?post=$1&page=$2&t=search_engine [L]
RewriteRule ^/forum/.*C([0-9]+)/?$ /perl/gforum/gforum.cgi?category=$1&t=search_engine [L]
RewriteRule ^/forum/.*F([0-9]+)/?$ /perl/gforum/gforum.cgi?forum=$1&t=search_engine [L]
RewriteRule ^/forum/.*F([0-9]+)-([0-9]+)/?$ /perl/gforum/gforum.cgi?forum=$1&page=$2&t=search_engine [L]
RewriteRule ^/forum/?$ /perl/gforum/gforum.cgi?t=search_engine [L]
RewriteRule ^/forum/.*gforum.cgi /perl/gforum/gforum.cgi?%{QUERY_STRING} [R,NE,L]


You can see a demo of this at:

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

Let me know what you think!

Cheers,

Alex
--
Gossamer Threads Inc.

Last edited by:

Alex: Jan 24, 2002, 6:34 PM
Quote Reply
Re: [Alex] Search Engine Friendly Templates! In reply to
Great idea, Alex!!! Wow!! Hope it will work on my server (did not try yet). Smile That will help a lot to index a site like mine which is 95% based on the dynamic pages of my forum.

How and when the static html pages are created? Each time there is a new post? Not sure to understand the way it works.

I found a little error: the "Jump to last post" doesn't work on the new category_list.html template.

Great idea!! I'm really impressed!! Wink

François

Last edited by:

Franco: Jan 27, 2002, 1:15 PM
Quote Reply
Re: [Franco] Search Engine Friendly Templates! In reply to
It's not static. The URL's are just made so they look static to search engine crawler.

Adrian
Quote Reply
Re: [brewt] Search Engine Friendly Templates! In reply to
This is what I was thinking. Smile

If all users use this kind of URL's as default does it put more load on the server than the standard URL's?

Thank you.
Quote Reply
Re: [Franco] Search Engine Friendly Templates! In reply to
Well, you have to have mod_rewrite for Apache installed. I'm not sure how much extra load it puts on the server (Alex can answer that). It's pretty much just translating the static looking urls into the gforum.cgi?do=... urls (as seen by the rewrite rules Alex posted).

Adrian
Quote Reply
Re: [brewt] Search Engine Friendly Templates! In reply to
I'm on Zeus (3.4). Is it possible to have mod_rewrite on Zeus? Or is there a similar module on Zeus who can make the same job? Unsure

Thank you.

François

Last edited by:

Franco: Jan 24, 2002, 9:52 PM
Quote Reply
Re: [Franco] Search Engine Friendly Templates! In reply to
Quote:
Zeus is a fast, scalable Web server. It has full clustering support to allow easy management of a large farm of Web servers. It includes FrontPage(tm) support, distributed server-side Java, 128bit SSLv3 encryption worldwide, unlimited virtual servers with groupable configuration, real-time statistics, bandwidth throttling, extensive logging options, Apache compatibility (including rewrite), and a Web-centric management interface. It supports application development in ISAPI, Java Servlets, secure CGI, FastCGI, NSAPI, and others.
Supposedly it does Wink I couldn't find anything useful on their site though.
There's this url:
http://www.zeus.com/...isapi/isapi-ex2.html
But it seems there's supposed to be a more elegant solution built in (from what I read). I've never touched Zeus, so I can't help you there.

Adrian
Quote Reply
Re: [Alex] Search Engine Friendly Templates! In reply to
What a great thing these rewrite rules. And thanks a lot for the templates!!

I am in the progress of implementing these new templates, actually I want to replace the old templates and only use the new templates.

My forum already resides in /forum/ so I had to change a few things in the rewrite rules.

1) If you want to use the new templates to replace to old ones, then make sure you add the globals of the new template (in globals.txt) to your own globals. You also need to change the rewrite rules a bit, e.g. the first line would be

RewriteRule ^/forum/.*P([0-9]+)/?$ /path/to/gforum.cgi?post=$1 [L]

and so on...

2) If your gforum.cgi already resides in the directory /forum/, you have to change the last line of the rewrite rules to:

RewriteRule ^/forum/.+gforum.cgi /forum/gforum.cgi?%{QUERY_STRING} [R,NE,L]

Note the plus sign instead of the multiplication sign (the multiplication sign results in an infinite redirection loop).

I hope that these remarks are helpful.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [Alex] Search Engine Friendly Templates! In reply to
Jack

Great idea, but there seems to be a problem with the links to last posts. Haven't installed to my server yet but tried the ones in this forum.

They give 404.

That's the ones you click on the arrow to get.

At the end of those URLs it says :
Quote:
Unknown tag 'post_id'

Maybe something missing in the template?

I guess it is so - but it could be helpful if you specify which templates dir to put in. I assume the default one.
---
Kjell Knudsen
http://www.icbl.org
Quote Reply
Re: [Alex] Search Engine Friendly Templates! In reply to
I noticed that the feature 'Jump to first unread post' doesn't work with the search_engine templates.

Thank you.

François
Quote Reply
Re: [Franco] Search Engine Friendly Templates! In reply to
That's because they are generally meant to bring people to our website from a search engine; jumping to the last unread post specifically needs arguments passed in, but the search engine templates aren't capable of it.

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [jagerman] Search Engine Friendly Templates! In reply to
So, if I use the search_engine templates as default (for all users), there is really no way to use the feature 'jump to the last unread post'?

Thank you.

François

Last edited by:

Franco: Jan 28, 2002, 9:52 PM
Quote Reply
Re: [Alex] Search Engine Friendly Templates! In reply to
I did not get it yet. I was looking for an tutorial at apache.org but I have no

understanding yet. I was trying to modify the htaccess to let my Detailed pages

from Links SQL appear in the same way. the .cgi is placed in the root, so I

tried to use ^/page.cgi.... to identify the url. But there is no difference in the results.

Does anyone know a ressource where I can read something about the rewrite rules.



Regards



Niko
Quote Reply
Re: [el noe] Search Engine Friendly Templates! In reply to
o.k. found it. I will post this in the LinksSQL Forum as well:
RewriteEngine on
RewriteRule ^news(.*)\.html$ /page.cgi?g=Detailed/$1&d=0
Quote Reply
Re: [Franco] Search Engine Friendly Templates! In reply to
The search_engine templates are meant to complement (and actually require) the default templates. As soon as you click "Main Index" in the search engine templates (or any of the other links at the top), you are taken out of the default templates and the last unread feature will work perfectly. These templates should be installed in admin/templates/search_engine. The .tplinfo file is important as well - it tells the template parser than any files not found in the search_engine templates should be pulled from the default template set.

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [jagerman] Search Engine Friendly Templates! In reply to
Installed the templates and copy the rules into the .htaccess file place in the forum directory but encountered the following error :

Can't call method "data" on an undefined value at /path....../admin/GForum/Post.pm line 245.

Please advice
Quote Reply
Re: [Alex] Search Engine Friendly Templates! In reply to
Anyway to use this on IIS?


Realiiity.com Forums
Quote Reply
Re: [ellipsiiis] Search Engine Friendly Templates! In reply to
Good question, and one I'm waiting to see the answer to. Although I did note something crawling through the forums the other day, I'll have to check my logs and see what it was.

-Another hosted on IIS

Last edited by:

heavybombers: Feb 1, 2002, 12:41 PM
Quote Reply
Re: [heavybombers] Search Engine Friendly Templates! In reply to
Unsure
Quote Reply
Re: [Franco] Search Engine Friendly Templates! In reply to
In Reply To:
I'm on Zeus (3.4). Is it possible to have mod_rewrite on Zeus? Or is there a similar module on Zeus who can make the same job? Unsure

Thank you.

François


You've probably already got the answer to this but... Yes Zeus does have rewrite capability. In fact, in the Zeus control panel, you can paste in the Apache mod_rewrite rules in Apache syntax and Zeus will automagically translate it into it's own syntax.

If only Zeus wasn't so expensive :(
Quote Reply
Re: [paulj] Search Engine Friendly Templates! In reply to
Any word on IIS?


Realiiity.com Forums
Quote Reply
Re: [ellipsiiis] Search Engine Friendly Templates! In reply to
Hi,

No, unfortunately we don't have a similiar solution available for IIS. We're looking into it, but without mod_rewrite or a working PATH_INFO feature, it's quite difficult.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Search Engine Friendly Templates! In reply to
I've installed Gossamer Forum in the /forum directory and uploaded the modified .htaccess file in the root directory so that /forum/gforum.cgi rewrites into /forum but I think nothing has changed... How can I enable this feature?
Thanks
Max
The one with Mac OS X Server 10.4 :)
Quote Reply
Re: [Alex] Search Engine Friendly Templates! In reply to
I don't know what the heck is wrong with me, but I just can't get this mod_rewrite thing to work. I've checked with my web host and they've assured me it's installed and enabled. I have installed the search engine templates, and I've got the following in an .htaccess file in my /site/support directory, which is the one I'd like to mirror the actual forum:

Code:


RewriteRule ^/site/support/.*P([0-9]+)/?$ /site/cgi-bin/support/gforum.cgi?post=$1&t=search_engine [L]

RewriteRule ^/site/support/.*P([0-9]+)-([0-9]+)/?$ /site/cgi-bin/support/gforum.cgi?post=$1&page=$2&t=search_engine [L]

RewriteRule ^/site/support/.*C([0-9]+)/?$ /site/cgi-bin/support/gforum.cgi?category=$1&t=search_engine [L]

RewriteRule ^/site/support/.*F([0-9]+)/?$ /site/cgi-bin/support/gforum.cgi?forum=$1&t=search_engine [L]

RewriteRule ^/site/support/.*F([0-9]+)-([0-9]+)/?$ /site/cgi-bin/support/gforum.cgi?forum=$1&page=$2&t=search_engine [L]

RewriteRule ^/site/support/?$ /site/cgi-bin/support/gforum.cgi?t=search_engine [L]

RewriteRule ^/site/support/.*gforum.cgi /site/cgi-bin/support/gforum.cgi?%{QUERY_STRING} [R,NE,L]


The thing is, I keep getting 500 Internal Server Errors! Does anyone know why this could be happening? I've tried tinkering with the file and the one vaguely interesting thing I've discovered is that If I remove the very last line but keep all the others, I no longer get the 500 errors, but I also don't get any forum pages - just an empty directory listing or 404 errors.

Thanks in advance for any advice.

Best regards,
Adam

Fractured Atlas :: Liberate the Artist
Services: Healthcare, Fiscal Sponsorship, Marketing, Education, The Emerging Artists Fund
Quote Reply
Re: [adamuforestasan] Search Engine Friendly Templates! In reply to
Does anything show up in Apache's error log?

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
> >