I am trying to redirect any request that does not start with specific patterns.
For example
mydomain.com/test/one/a
mydomain.com/test/one/b
and
mydomain.com/user/name/a
mydomain.com/user/name/b
So any request that does not match with mydomain.com/test/one or mydomain.com/user/name will redirect to some page or web address.
So far i can match following
RewriteCond %{REQUEST_URI} ^(/test/one|/user/name) [NC]
RewriteRule .* - [F]
so any url started with /test/one or /user/name is redirecting properly.
But when i am trying to negate the condition with ! , its redirecting every requests!
RewriteCond %{REQUEST_URI} !^(/test/one|/user/name) [NC]
RewriteRule .* - [F]
But i want all request to redirect except REQUEST_URI has pattern like
^(/test/one|/user/name)