in reply to mod_rewrite woes

Here's what I think you want (in a .htaccess in /subDir/):
RewriteEngine on RewriteBase /subDir/ # only redirect if the file requested isn't index.cgi # capture anything else and redirect it to index.cgi RewriteCond %{REQUEST_FILENAME} !^index.cgi RewriteRule ^(.+)/?$ index.cgi?rm=$1 [L]
If you'd rather it be transparent to the user (that is, they don't see the index.cgi?rm=foo), then change the [L] to [P].

Replies are listed 'Best First'.
Re: Re: mod_rewrite woes
by geektron (Curate) on Jan 30, 2004 at 01:04 UTC
    thanks. i'll have to play with this. it fails with the same problem:
    No such run mode ( index.cgi ).
    i'll have to read up more later.
      FWIW, the example I posted works for me. Anyway, what that error hints to me is that the RewriteCond isn't working correctly (it's not letting requests to index.cgi through, instead it's redirecting them). If you turn on log level 9, mod_rewrite will write out *everything* it does; that should help in debugging.
        i'll up the debug level tomorrow at work.

        my assumption is the same. the orig request was to:

        www.mydomain.com/subDir/sale
        which spat out the error ... if all else fails i don't *have* to name it index.cgi.