Forum Moderators: phranque

Message Too Old, No Replies

Redirect All But Two Directories

         

solokron

11:22 pm on Feb 27, 2007 (gmt 0)

10+ Year Member



I have been using:

RewriteEngine on
RewriteCond $1!^phpmyadmin
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

to rewrite a url except one directory. How can I supplement this to do all but two directories?

Thank you.

jdMorgan

2:08 pm on Feb 28, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



1) Add a "local OR" to the first RewriteCond:

RewriteCond $1 !^(phpmyadminŠotherdir)

-or-
2) Add another RewriteCond:

RewriteCond $1 !^phpmyadmin
RewriteCond $1 !^otherdir

Replace the broken pipe "Š" character with a solid pipe character before use; Posting on this board modifies the pipe characters.

For more information, see the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].

Jim

solokron

4:25 am on Mar 1, 2007 (gmt 0)

10+ Year Member



Thanks jd!