Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Re: [pugdog] Dynamic to Static-look URLs -- hints

Quote Reply
Re: [pugdog] Dynamic to Static-look URLs -- hints In reply to
In Reply To:

The format I use is:


RewriteRule ^/$ /empty_dir/ [R,L,NC]
RewriteRule ^/empty_dir/?$ /empty_dir/ [L,NC]

<Directory /var/home/path/to/empty/empty_dir/>
Options All -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
RewriteEngine On
RewriteRule (.*) /cgi-bin/LinkSQL/page.cgi?g=$1 [L]
AllowOverride All
Allow From All

First, you need to set up the first two rewrite rules, then create an EMPTY directory, in the public tree, that is used to force the rewrite. The above <directory> directives are in my httpd.conf file, but can be used in an .htaccess file.

The red R is optional, and I'll explain it later. The blue "/" is _MANDATORY_ and this line prevents Links from generating "We do not have a category..." and printing out your path name as an error.

The green [L,NC] _seems_ to be a good idea, but it doesn't always work, and I'm not sure why.

Back to the first rewrite rules.

The first rule rewrites your domain name to the empty directory, which forces _everything_ to pass through the page.cgi file.

When you add an R to the flags, you will get a visible URL :


This often shows _NO_ page rank, and gives people ulcers. If you add the R, you'll see:


That "appears" better to most people, but I did some checking on sites I had running for at least 6 months to a year, or more, and when I changed the [R,L,NC] that was showing /empty_dir or /empty_dir in the URL -- with a PR of 0, to [L,NC], when I looked at the http://domain.com/ resulting url, some pages were as high as a 6. *SO* google ignored the rewrite completely, and ranked the incoming URL, anyway.

How this translates into search engine listing, I don't know, but I'd take a PR of 6 any day <G>
I tried your code in an .htaccess file in a subdomain. Of course it failed, or I wouldn't be writing.

I got a 500 error from the start. I created an empty directory in the public area called /news, replaced /empty_dir/ with /news/ in the script, and tried every variation I could think of for <Directory /var/home/path/to/empty/empty_dir?> without any success. Of course, since in my install the page.cgi is in /cgi-bin/, I modified that path in the RewriteRule as well.

Perhaps, as a 'gotcha', it might help to know I have standard HTML pages in the same subdomain, with those pages linking off to the dynamic GL install, yet simply trying to reach the site's index.html page causes the 500 error.

I'm thinking I'm missing something basic, but I don't know much about mod_rewrite (and not much more about .htaccess itself), so can you give me the dummy version of your code?

Alan Frayer
Don't just read the news - make the news!
Your World News - http://yourworldnews.frayernet.com
Subject Author Views Date
Thread Dynamic to Static-look URLs -- hints pugdog 3317 May 15, 2005, 1:33 PM
Thread Re: [pugdog] Dynamic to Static-look URLs -- hints
afrayer 3117 Aug 7, 2006, 6:04 AM
Thread Re: [afrayer] Dynamic to Static-look URLs -- hints
afrayer 3104 Aug 8, 2006, 8:56 AM
Thread Re: [afrayer] Dynamic to Static-look URLs -- hints
afrayer 3080 Aug 12, 2006, 4:28 AM
Thread Re: [afrayer] Dynamic to Static-look URLs -- hints
pugdog 3055 Aug 13, 2006, 9:31 PM
Post Re: [pugdog] Dynamic to Static-look URLs -- hints
afrayer 3047 Aug 14, 2006, 2:34 AM