views:

180

answers:

2

I'm trying to get my .htaccess to redirect all requests to the /blogs directory, except for requests that start with /staff. This is what I have so far:

RewriteEngine On
RewriteRule ^staff(.*)$ staff/$1 [L]
RewriteRule ^(.*)$ blogs/$1 [L]

It works fine for every case, except when I do http://mydomain.com/staff or http://mydomain.com/staff/alice in which case I get a 500 Internal Error.

What am I doing wrong?

A: 

What is logged to error.log? The error may be coming from either mod_rewrite or from your application itself.

vladr
+1  A: 

Try this:

RewriteRule ^staff/  - [L]
RewriteRule !^blogs/ blogs%{REQUEST_URI} [L]
Gumbo
Worked like a charm, thanks.
cdmckay