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

Search Engine Friendly Templates!

(Page 2 of 5)
> > > >
Quote Reply
Re: [Jagerman] Search Engine Friendly Templates! In reply to
Thanks so much for the reply. I'm still relatively new at this stuff, so I wouldn't have thought to check the error log on my own.

There is one error which seems to be the real culprit:

[Mon Jun 24 16:52:40 2002] [alert] [client xx.xxx.xxx.xxx] /path/to/.htaccess: RewriteRule: unknown flag 'NE'

Which would seem to gel with the experience that once I got rid of that last line, I started getting 404 errors instead of 500 errors...

Does this give you any ideas? Thanks again.

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
Hi,

Maybe try something similar to this (below): (Note that RewriteEngine will not work with FrontPage extensions.)




RewriteEngine on
Options +FollowSymlinks
RewriteBase /
RewriteRule ^\.htaccess$ - [F]

RewriteRule ^(.*)site/support/(.*)P([0-9]+)/?$ /site/cgi-bin/support/gforum.cgi?post=$3&t=search_engine [L]
RewriteRule ^(.*)site/support/(.*)P([0-9]+)-([0-9]+)/?$ /site/cgi-bin/support/gforum.cgi?post=$3&page=$4&t=search_engine [L]
RewriteRule ^(.*)site/support/(.*)C([0-9]+)/?$ /site/cgi-bin/support/gforum.cgi?category=$3&t=search_engine [L]
RewriteRule ^(.*)site/support/(.*)F([0-9]+)/?$ /site/cgi-bin/support/gforum.cgi?forum=$3&t=search_engine [L]
RewriteRule ^(.*)site/support/(.*)F([0-9]+)-([0-9]+)/?$ /site/cgi-bin/support/gforum.cgi?forum=$3&page=$4&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} [NS,L]




Good luck! Smile

François
Quote Reply
Re: [adamuforestasan] Search Engine Friendly Templates! In reply to
Hi,

Yes, unfortunately that is a problem with older versions of Apache. I believe the NE tag was added around 1.3.20, but it appears your version is older. Try removing the 'NE' flag and see how things work - it may not be perfect, but it should get the job done. Unfortunately, you may run into problems without it.

I have a possible fix for you, which involves replacing all the occurances of 'gforum.cgi' with '<%cgi_root_url%>/gforum.cgi' in the search engine templates. If you do this, the NE flag is no longer required.

If you have shell access, this command run from the search_engine template set directory should fix it for you:

Code:


perl -p -i.bak -e 's|gforum\.cgi|<%cgi_root_url%>/gforum.cgi|g'

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [Jagerman] Search Engine Friendly Templates! In reply to
Okay, I removed the NE tag and made those changes to the templates, but now when I go to /site/support I just get an empty index listing. If I go to /site/support/gforum.cgi I get a 404 error...

Any other thoughts? Should I try Franco's suggestion above?

Thanks again,
Adam

Fractured Atlas :: Liberate the Artist
Services: Healthcare, Fiscal Sponsorship, Marketing, Education, The Emerging Artists Fund
Quote Reply
Re: [Jagerman] Search Engine Friendly Templates! In reply to
Okay, interesting development...

I took Franco's code above and put that in the .htaccess file, which partially worked.

Here's what I now have:

Code:


RewriteEngine on

Options +FollowSymlinks

RewriteBase /

RewriteRule ^\.htaccess$ - [F]

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} [NS,L]


That seems to work as far as bringing up the main category listing page at /site/support. However, at /site/support/, it brings up an empty index page. More significantly, none of the internal links work. When I click on any of the forum or category listings, I get a 404 error. When I click on one of the "jump to post" or other links that go to the "regular" forum, they work fine. But only the main category listing is doing what it's supposed to ala mod_rewrite...

The other little bit of news is that I just found out that my web host uses Apache version 1.3.19, but will be upgrading to 1.3.26 in a few days. Maybe the easiest thing to do is just wait for this upgrade and then use the original version...

Thanks for all the help.

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
Hi Adam,

I think I know where comes from your problem. Change the path '/forum' for '/site/support' in the seach_engine template global vars "cat_full_name_linked" and "cat_path".

Let me know how it goes!

François

Sorry for my poor english...

Last edited by:

Franco: Jun 27, 2002, 3:48 PM
Quote Reply
Re: [Franco] Search Engine Friendly Templates! In reply to
Francois,

Vous parlez (ecrivez?) anglais beaucoup mieux que je parle francais! Pirate

I actually already changed those variables. In fact I'm pretty sure the correct search-engine-friendly urls are being linked to, the rewrite rules just aren't making them display the right content. I checked the error log (thanks to Jagerman I thought to do this this time) and all it says is that:

[Thu Jun 27 15:52:44 2002] [error] [client xxx.xxx.xxx.xx] File does not exist: /path/to/site/support/Fractured_Atlas_Member_Services_C1/Grants_F2/

I'm beginning to get a vague sense for why people say mod_rewrite is like voodoo!

Thanks for your help,
Adam


Fractured Atlas :: Liberate the Artist
Services: Healthcare, Fiscal Sponsorship, Marketing, Education, The Emerging Artists Fund
Quote Reply
Re: [Alex] Search Engine Friendly Templates! In reply to
Hi Alex or Jagerman or anyone.

I notice this thread is quite a few months old so I am wondering if anything might have changed in implementing search engine friendliness with the current version?

Do I need to change the current templates (v1.1.7) at all? And is the .htaccess info still valid?

Thanks


http://www.iuni.com/...tware/web/index.html
Links Plugins
Quote Reply
Re: [Ian] Search Engine Friendly Templates! In reply to
Are other people having trouble with this? I never did get my setup working, even after the version of Apache on my web server was upgraded. The best I could muster was a search engine friendly main index page - none of the category, forum, or post pages would "rewrite" properly.

Just trying to get a sense for whether this is a common problem, or there's some issue with my web server, or if I'm just some kind of moron. Unsure

Fractured Atlas :: Liberate the Artist
Services: Healthcare, Fiscal Sponsorship, Marketing, Education, The Emerging Artists Fund
Quote Reply
Re: [hennagaijin] Search Engine Friendly Templates! In reply to
Yes I have the same problem. Frown
Max
The one with Mac OS X Server 10.4 :)
Quote Reply
Re: [maxpico] Search Engine Friendly Templates! In reply to
hennagaijin try to put this directives in your httpd.conf file and restart Apache:

RewriteLog "/path/to/logs/rewrite.log"
RewriteLogLevel 3

This will allow you to track the actions made by the module and to debug. After debugging you must delete those lines and restart.
Max
The one with Mac OS X Server 10.4 :)
Quote Reply
Re: [maxpico] Search Engine Friendly Templates! In reply to
Thanks, Max. Unfortunately I'm on a shared server, so there are limits to the kinds of things I can change. Did you ever end up getting it to work for you?

Fractured Atlas :: Liberate the Artist
Services: Healthcare, Fiscal Sponsorship, Marketing, Education, The Emerging Artists Fund
Quote Reply
Re: [hennagaijin] Search Engine Friendly Templates! In reply to
No Unsure
I read the Apache.org docs about mod_rewrite but nothing changed...
The strange thing is that the apache error log and the rewrite log doesn't mention anything....
Max
The one with Mac OS X Server 10.4 :)
Quote Reply
Re: [maxpico] Search Engine Friendly Templates! In reply to
I've got something that may help those of you encountering problems getting rewrite going. By default, rewrite translates into a path rewrite instead of a URL rewrite, so on many servers you'll run into this problem:

http://myserver -> /www/htdocs

and so, of course, a path looks like:

http://myserver/foo -> /www/htdocs/foo

which is fine. By default, mod_rewrite changes the requested path and file to the system path. Hence, when you encounter an Alias or ScriptAlias, such as the very common case:

http://myserver/cgi-bin -> /www/cgi-bin

the rewrite breaks. It actually ends up looking for /www/htdocs/cgi-bin/gforum/gforum.cgi instead of /www/cgi-bin/gforum/gforum.cgi, and hence breaks.

Anyway, the long-winded explanation over, the solution (if this is indeed where the problem lies) is to use the "PT" (passthrough) option. Basically, you change your rewrite lines adding the bit in red:

RewriteRule ^/fo......&t=search_engine [L,PT]

Do not, however, add "PT" to the last rule (the gforum.cgi one that ends with: [R, NE, L]).

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [Alex] Search Engine Friendly Templates! In reply to
I keep forgetting to post this, but there's now an IIS capable rewrite deal at http://www.qwerksoft.com/products/iisrewrite/ for $100 bucks. We've been using the free trial version and it works fine with the templates.


Realiiity.com Forums
Quote Reply
Re: [Jagerman] Search Engine Friendly Templates! In reply to
Thanks for continuing to plug away at this! Unfortunately, my setup still doesn't work. Adding the PT option didn't appear to have any effect.

So far, the "official version" still gets me a blank directory listing or 404 pages, and Franco's slight edit generates a main category listing but no category, forum, or post pages... Same thing with or without the "PT". Unsure

I'm wondering if there's any correlation between functioning and non-functioning versions of these templates and dedicated vs. shared servers. This is kind of a shot in the dark, since I frankly know so little about this stuff, but your reference to those low level unix directories seems like it must be on the right track and makes me wonder if my problems could have to do with the fact that I'm on a shared host. Just a thought. Thanks again.

Fractured Atlas :: Liberate the Artist
Services: Healthcare, Fiscal Sponsorship, Marketing, Education, The Emerging Artists Fund
Quote Reply
Re: [hennagaijin] Search Engine Friendly Templates! In reply to
Hi,

If you email me shell access, I can take a look for you.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Search Engine Friendly Templates! In reply to
Thank you so much for offering to help. I just composed a PM to you with all the relevant info, and in the process of explaining my directory structure, I realized a stupid mistake that I made. (Don't ask - it was really stupid...) I just corrected that, and now it works! Happy, happy, day!! Thanks again!

Fractured Atlas :: Liberate the Artist
Services: Healthcare, Fiscal Sponsorship, Marketing, Education, The Emerging Artists Fund
Quote Reply
Re: [hennagaijin] Search Engine Friendly Templates! In reply to
Glad to hear! Did it work without the PT, or did you end up needing that?

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Search Engine Friendly Templates! In reply to
I did need the PT, yes. The version that works for me is Franco's version with PT tags added to everything but the last line. Granted, I've just started testing, so I may yet encounter difficulties. But so far, so good.

Fractured Atlas :: Liberate the Artist
Services: Healthcare, Fiscal Sponsorship, Marketing, Education, The Emerging Artists Fund
Quote Reply
Re: [hennagaijin] Search Engine Friendly Templates! In reply to
Can someone help me?
I can't get it working.... Crazy
Max
The one with Mac OS X Server 10.4 :)
Post deleted by shiner In reply to
Quote Reply
Re: [Alex] Search Engine Friendly Templates! In reply to
Alex,

thank you for the PM and the link to this thread. I am getting Internal Server Errors when I try to view the /forum/ section.

Here is what I have done:

1) created the /forum/ directory off of my root /web

2) dropped in your .htaccess code with the ,PT just to be safe

3) looked up the installed modules to check for mod_rewrite -- and this is what I think is missing, but I may not know what I am looking for. I see nothing with the word rewrite. would it read "mod_rewrite" or would it say Apache::Rewrite or Cobalt::Rewrite?

If this is my problem, what would I ask my host to install? mod_rewrite? Sorry if that is obvious, but I am just trying to figure this out. I first put the .htaccess in the root and watched as the site subsequently crashed... and then I read on to see that it went in /forum - so I am learning!

Last edited by:

shiner: Jan 28, 2003, 9:41 PM
Quote Reply
Re: [shiner] Search Engine Friendly Templates! In reply to
You'll need to ask your webhost to install the mod_rewrite module. If you have access to your Apache httpd.conf file, you can check it to see if it's installed. It could well be installed but not enabled, and therefore would have a preceding hash (#) on the line where the module is loaded. Mine looks something like:

Code:
memphis% cat /etc/apache/httpd.conf | grep mod_rewrite
LoadModule rewrite_module /usr/lib/apache/1.3/mod_rewrite.so
memphis%

Hope this helps.

- wil
Quote Reply
Re: [Wil] Search Engine Friendly Templates! In reply to
Thank you Will! I thought this post had died. I have contacted the host and have found that the level of service is on par with what I pay for the hosting - next to nothing... So, I am researching new hosts. If my site was revenue making I would probably use Paul or gossamer to host it, simply because of their level of service and intimate product knowledge, but alas - the site is free and so this is a direct expendature for me personally and I have to find cut rate hosting - and with that goes service.



Thanks again and I will look for this with my next host.
> > > >