I am trying to redirect an entire directory on a WP site to a directory on a new domain, with a few subdirectory exceptions that exist on the new domain.
e.g.
Redirect /2012/ to newdomain.com/blog
Redirect /2012/subdirectory to newdomain.com/2012/subdirectory
This is what I have that is not working:
#blanket redirect with exceptions
RewriteCond %{REQUEST_URI} !^/2012/$
RewriteCond %{REQUEST_URI}
!^/2012/(\/2012\/subdirectory1\/|\/2012\/subdirectory2\/|\/2012\/subdirectory1\/)
RewriteRule ^/?2012/(.+)$ http://www.newdomain.com/blog/ [L,R=301]
#redirecting the exceptions
RewriteCond %{HTTP_HOST} ^old-domain\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.old-domain\.com$
RewriteRule ^\/2012\/subdirectory1\/$
"http\:\/\/www\.newdomain\.com\/2012\/subdirectory1\/" [R=301,L]
Thanks!