Forum Moderators: phranque
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI}!^/alpha(.*)$
RewriteRule (.*) [anothersite.com...] [R=301,L]
It works..... but if I want a /beta directory be skipped, it doesn't work... well at least, how I did:
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI}!^/alpha(.*)$ [OR]
RewriteCond %{REQUEST_URI}!^/beta(.*)$
RewriteRule (.*) [anothersite.com...] [R=301,L]
Apache ignores rewriting in this case... why?
Also I tried this:
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI}!^/alpha(.*)$
RewriteRule (.*) [anothersite.com...] [R=301,L]
RewriteCond %{REQUEST_URI}!^/beta(.*)$
RewriteRule (.*) [anothersite.com...] [R=301,L]
And didn't work either...
How can I solve it?
Thanks in advance!
I did:
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI}!^/alpha¦beta(.*)$
RewriteRule (.*) [anothersite.com...] [R=301,L]
And it worked!
But anyway I don't understand why other methods didn't work
:S
For example, what is the result of the following logical statement?
If color NOT(Blue) OR NOT(Red) then True.
Tell me what one color you'd name to make that statement False.
Hint: There is no color you can name that is both red and blue...
In general, negative-true patterns should be ANDed, while positive-true patterns are usually ORed.
If you are interested in further studies of combinatorial logic, try searching for "DeMorgan's Theorem" which establishes the following:
a OR b == NOT ( NOT(a) AND NOT(b) )
a AND b == NOT ( NOT(a) OR NOT(b) )
This comes in handy when trying to simplify RewriteConds, and occasionally can make a seemingly-impossible function much easier to implement.
Jim