The task is to make a redirect from one domain to another. With the exception of the / old / directory

The redirect itself is easy to make, but I can not understand how to make an exception for the directory with a redirect.

UPD

A small clarification. From the old site should be redirected to the new site, regardless of the address.

I will explain. There are two addresses: example.com/?p1 example.com/?p2

It is necessary that from all pages be redirected to newexample.com

With the exception of the old folder

    1 answer 1

    In the example, the redirection of all the pages of the old site to the main page http://new.site.com/ except the folder somefolder, all pages in the folder somefolder are available at the same address.

    .htaccess:

    RewriteEngine on RewriteCond %{REQUEST_URI} !^/somefolder RewriteRule ^(.*) http://new.site.com/ [L,R]