title: How can I redirect from old domain to new one excerpt specific directories?
body: <p>I've changed the domain of wordpress and would like to redirect only EC pages.(The domains are example.)</p>
  <pre><code>・Old Domain -&gt; https://old-domain.com
  ・New Domain -&gt; https://new-domain.com
  </code></pre>
  <p>I want to redirect all pages from old to new, except these pages.</p>
  <pre><code>・shop
  ・product
  ・cart
  ・checkout
  </code></pre>
  <p>And I wrote those on my htaccess file.</p>
  <p>▼Old Domain（Wanna redirect <strong>only</strong> shop, product, cart, checkout directories to New Domain.）</p>
  <pre><code>RewriteEngine on
  RewriteBase /
  RewriteRule ^shop(.*)$ https://new-domain.com/shop$1 [R=301,L]
  RewriteRule ^product(.*)$ https://new-domain.com/product$1 [R=301,L]
  RewriteRule ^cart(.*)$ https://new-domain.com/cart$1 [R=301,L]
  RewriteRule ^checkout(.*)$ https://new-domain.com/checkout$1 [R=301,L]
  </code></pre>
  <p>▼New Domain（Wanna redirect all pages to Old Domain, <strong>excerpt</strong> shop, product, cart, checkout directories.）</p>
  <pre><code>RewriteEngine On
  RewriteBase /
  RewriteCond %{REQUEST_URI} !^/shop/$
  RewriteCond %{REQUEST_URI} !^/product/$
  RewriteCond %{REQUEST_URI} !^/cart/$
  RewriteCond %{REQUEST_URI} !^/checkout/$
  RewriteRule (.*) https://old-domain.com [R=301,L]
  </code></pre>
  <p>Both of them do not work. It seems to redirect correctly in a moment, but immediately back to <strong><a href="https://new-domain.com" rel="nofollow noreferrer">https://new-domain.com</a></strong>.
  Please help me to solve it.</p>