Forum Moderators: phranque

Message Too Old, No Replies

redirect all requests except two folders

how do I use mod_rewrite to do this?

         

bwstyle

4:48 pm on Jul 27, 2006 (gmt 0)

10+ Year Member



I'd like to use this redirect to put a holding page up, but allow for certain pages/directories as exceptions. I'm not sure how to allow for them.

RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteRule ^(.*)$ http://www.example.com/temporarily_down.html [R=302,L]

jdMorgan

5:29 pm on Jul 27, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Generally, the 'NOT' form of RewriteCond is handy for this:

RewriteCond %{REQUEST_URI} [b]![/b]^path_to_excluded_directory_or_file$

Jim

bwstyle

7:37 pm on Jul 27, 2006 (gmt 0)

10+ Year Member



this line would appear between the above two? does it also include [NC]?