Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: mod_rewrite woes

by The Mad Hatter (Priest)
on Jan 29, 2004 at 23:21 UTC ( [id://325078]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://325078]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2024-04-25 13:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found