Apr 17, 2004, 2:23 AM
Veteran / Moderator (18436 posts)
Apr 17, 2004, 2:23 AM
Post #2 of 23
Views: 7628
This is what I use on my sites;
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
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!
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

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!
Apr 17, 2004, 4:11 AM
Veteran / Moderator (6956 posts)
Apr 17, 2004, 4:11 AM
Post #3 of 23
Views: 7545
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.
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.
Apr 17, 2004, 9:33 AM
User (353 posts)
Apr 17, 2004, 9:33 AM
Post #4 of 23
Views: 7586
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
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
Apr 17, 2004, 5:07 PM
User (353 posts)
Apr 17, 2004, 5:07 PM
Post #5 of 23
Views: 7566
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
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
Apr 17, 2004, 6:23 PM
Veteran / Moderator (6956 posts)
Apr 17, 2004, 6:23 PM
Post #6 of 23
Views: 7565
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.
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.
Apr 18, 2004, 2:26 AM
Veteran (1921 posts)
Apr 18, 2004, 2:26 AM
Post #7 of 23
Views: 7552
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.
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.
Apr 18, 2004, 10:06 AM
User (353 posts)
Apr 18, 2004, 10:06 AM
Post #10 of 23
Views: 7526
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
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
Apr 18, 2004, 11:07 AM
User (353 posts)
Apr 18, 2004, 11:07 AM
Post #12 of 23
Views: 7521
Thanks again afinlr,
I was experimenting with something similar
Thanks again
ccunet
my Christian web
Apr 18, 2004, 3:08 PM
User (118 posts)
Apr 18, 2004, 3:08 PM
Post #13 of 23
Views: 7501
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
>> Nakul Goyal (SEO, Link Building Expert)
Web Site Promotion
Tips 'n' Tricks
SEO News
Apr 19, 2004, 5:55 AM
User (353 posts)
Apr 19, 2004, 5:55 AM
Post #16 of 23
Views: 7490
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
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
Apr 19, 2004, 6:59 AM
Veteran (1921 posts)
Apr 19, 2004, 6:59 AM
Post #17 of 23
Views: 7495
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?
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?
Apr 20, 2004, 7:18 AM
Veteran / Moderator (6956 posts)
Apr 20, 2004, 7:18 AM
Post #18 of 23
Views: 7500
Sorry, I missed this:
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:
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.
Jun 21, 2004, 7:03 AM
User (104 posts)
Jun 21, 2004, 7:03 AM
Post #19 of 23
Views: 7435
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
Megrisoft
Web Hosting Company
India Software Company
SEO Company
Jun 24, 2004, 1:41 PM
User (214 posts)
Jun 24, 2004, 1:41 PM
Post #20 of 23
Views: 7397
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
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
Jun 24, 2004, 3:16 PM
Veteran / Moderator (18436 posts)
Jun 24, 2004, 3:16 PM
Post #21 of 23
Views: 7382
Or even cooler...
http://www.site.com/search/your%20keywords%20here
Pugdog makes use of this: http://postcards.com/search/cottage
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!
http://www.site.com/search/your%20keywords%20here
Pugdog makes use of this: http://postcards.com/search/cottage

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!
Jun 24, 2004, 3:17 PM
Veteran / Moderator (18436 posts)
Jun 24, 2004, 3:17 PM
Post #22 of 23
Views: 7417
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!
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!
Jun 25, 2004, 2:04 AM
User (214 posts)
Jun 25, 2004, 2:04 AM
Post #23 of 23
Views: 7419
As you can see, I don’t how this works
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

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