Gossamer Forum
Home : Products : Gossamer Links : Discussions :

standard mod_rewrite for lsql

Quote Reply
standard mod_rewrite for lsql
Are there a standard search engine friendly rewrite rules for lsql?

Andre
my Christian web

Last edited by:

ccunet: Apr 16, 2004, 1:18 PM
Quote Reply
Re: [ccunet] standard mod_rewrite for lsql In reply to
This is what I use on my sites;

Code:
RewriteEngine On
RewriteRule (.*)\.css $1.css [L]
RewriteRule ^images/(.*) images/$1 [L]
RewriteRule ^AddImages/(.*) AddImages/$1 [L]
RewriteRule ^Images/(.*) Images/$1 [L]
RewriteRule ^p/(.*) /cgi-bin/page.cgi?g=$1 [L]
RewriteRule ^info/(.*) /cgi-bin/page.cgi?p=$1 [L]
RewriteRule ^(.*).html /cgi-bin/page.cgi?g=$1.html [L]
RewriteRule ^$ /cgi-bin/page.cgi [L]

http://www.yoursite.com/*/*.html will go to page.cgi?g=*
http://www.yoursite.com/p/something will goto page.cgi?p=something (great for extra detail pages).
http://www.yoursite.com will goto page.cgi
Images, images and AddImages will all be directed normally.

Hope that helps Smile

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: [Andy] standard mod_rewrite for lsql In reply to
I use something much simpler :)
See:

http://www.gossamer-threads.com/...orum.cgi?post=263431

This is actually what Ultranerds.com is running on, and most of those sites. Andy's development sites, and his others are running the more complex code. For most people, the simpler rules work fine, and they have fewer "gotchas".

All you need to do is pick a search engine friendly 1st level directory, such as site, resources, art, whatever describes your site well, and and then create the empty directory in your document root.

Add the codes (with "resources" changed to whatever your directory name is) and restart the server (or put it into the main .htaccess).

Andy's rule sets are more complex. Images won't be rwritten in my rule sets, they can stay right where they are.

We've gotten some good page ranks, and targeting with the simple rules.

with the simple rules you just create one dummy directory. Andy's requires some additional planning, and tweaking, but you can handle special cases a bit better -- he's a special needs sort of fellow ;) (ducking).


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] standard mod_rewrite for lsql In reply to
Thanks Andy, Pugdog,
Pugdog one question. Does the directory have to be empty. I've been running in static mode till now. so I already have directory guide where my static pasges are being built. Can I use that as we rewrite directory?

ccunet
my Christian web
Quote Reply
Re: [Andy] standard mod_rewrite for lsql In reply to
Thanks Andy!
I got your rules working on my site. But the rules affect all my links on lsql generated pages. For instance if I try to go to my plain directory www.mysite.com/faith I get the following error.
Oops, we had the following problem:
We don't seem to have a category by the name 'faith/index..html'.

How can I correct that?
Thanks
CCUnet
my Christian web

Last edited by:

ccunet: Apr 17, 2004, 5:44 PM
Quote Reply
Re: [ccunet] standard mod_rewrite for lsql In reply to
Can't help you with Andy's rules, but that error occurs with my rewrite rule set if I don't add that second rule -- specifically the '/?' part, which allows a url without the trailing '/' to be rewritten.

Not sure what goes on with andy's rules... Like I said, mine are simple :) they don't hurt my head <G>


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [ccunet] standard mod_rewrite for lsql In reply to
This is the problem:

RewriteRule ^(.*).html /cgi-bin/page.cgi?g=$1.html [L]

This doesn't allow you to have any static pages on your site - all index.html will be rewritten to dynamic Links pages. If you use a specific directory for your links pages, you can just put the directory into this rule and it will only rewrite static pages in that directory.
Quote Reply
Re: [afinlr] standard mod_rewrite for lsql In reply to
In Reply To:
If you use a specific directory for your links pages, you can just put the directory into this rule and it will only rewrite static pages in that directory.


I need to add the path to that directory?

ccunet
my Christian web
Quote Reply
Re: [ccunet] standard mod_rewrite for lsql In reply to
Yes, like this:

RewriteRule ^/links/(.*).html /cgi-bin/page.cgi?g=$1.html [L]
Quote Reply
Re: [afinlr] standard mod_rewrite for lsql In reply to
Thanks afinlr,
Is there are way to solve the trailing slash porblem. Right now if try to got to a category using just
www.mysite.com/guide/business I get a page error. I have to type in the complete page location www.mysite.com/guide/business/index.html.

Thanks for the help

ccunet
my Christian web
Quote Reply
Re: [ccunet] standard mod_rewrite for lsql In reply to
I would replace the rule above with this

RewriteRule ^/guide/(.*)$ /cgi-bin/page.cgi?g=$1 [L]
Quote Reply
Re: [afinlr] standard mod_rewrite for lsql In reply to
In Reply To:
I would replace the rule above with this

RewriteRule ^/guide/(.*)$ /cgi-bin/page.cgi?g=$1 [L]

Thanks again afinlr,
I was experimenting with something similar

Thanks again
ccunet
my Christian web

Last edited by:

ccunet: Apr 18, 2004, 11:20 AM
Quote Reply
Re: [ccunet] standard mod_rewrite for lsql In reply to
Andy and Pugnog, thanks for that. I was thinking of doing something for a client of mine in this direction and I have it all readymade here. It's like cooked food ready to eat for me. Thanks everybody for the help.
>> Nakul Goyal (SEO, Link Building Expert)
Web Site Promotion
Tips 'n' Tricks
SEO News


Quote Reply
Re: [ccunet] standard mod_rewrite for lsql In reply to
Afinlr,
Didn't work

ccunet
my Christian web
Quote Reply
Re: [ccunet] standard mod_rewrite for lsql In reply to
In what way didn't it work? Are you putting these rules in httpd.conf or an htaccess file?
Quote Reply
Re: [afinlr] standard mod_rewrite for lsql In reply to
Afinlr,
Sorry should have been more specific. www.mysite.com/guide/dirname/ or www.mysite.com/guide/dirname still give me unauthorized access page error. thanks foir the help and patience

ccunet
my Christian web
Quote Reply
Re: [ccunet] standard mod_rewrite for lsql In reply to
Hi,

If it is an unauthorised access error you are getting rather than a 404 not found error, I have a feeling this may be because you have set Options -Indexes. In your error log do you get

Directory index forbidden by rule: /path/to/dirname/

or something else?
Quote Reply
Re: [ccunet] standard mod_rewrite for lsql In reply to
Sorry, I missed this:
Quote:


Thanks Andy, Pugdog,
Pugdog one question. Does the directory have to be empty. I've been running in static mode till now. so I already have directory guide where my static pasges are being built. Can I use that as we rewrite directory?


No, I don't think the directory has to be empty, but it cannot contain an actual directory name or file name that matches anything passed in.

The rewrite rule _SHOULD_ ignore an existing directory name (after all, that is what a rewrite rule is for), but I have had quirky problems.

This will be trial and error -- if you do have a duplicate name, it's very hard to tell which pages are being served -- the static on disk, or the dynamic.


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] standard mod_rewrite for lsql In reply to
It is easy to work on the rewrite mod but it take lot of resources how it can be reduced but it can be very helpful in search engine optimization and ranking
Megrisoft
Web Hosting Company
India Software Company
SEO Company


Quote Reply
Re: [pugdog] standard mod_rewrite for lsql In reply to
Do any of you folks use search.cgi in your rewrite rules?

Perhaps this:

http://www.yoursite.com/search.cgi?query=xxx

instead of:

http://www.yoursite.com/cgi-bin/linksql/search.cgi?query=xxx

Much neater.

--------------------------------
Privacy Software
Quote Reply
Re: [BLOOD] standard mod_rewrite for lsql In reply to
Or even cooler...

http://www.site.com/search/your%20keywords%20here

Pugdog makes use of this: http://postcards.com/search/cottage

Cool

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: [Andy] standard mod_rewrite for lsql In reply to
BTW.. the code for that would be something like;

RewriteRule ^search/(.*) /cgi-bin/links/search.cgi?query=$1 [L]

Just in case anyone wants to know :)

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: [Andy] standard mod_rewrite for lsql In reply to
As you can see, I don’t how this works Frown

http://www.yoursite.com/search.cgi?query=xxx

RewriteRule ^/search.cgi?query=(.*) /cgi-bin/links/search.cgi?query=$1 [L]

cant be correct?

--------------------------------
Privacy Software