# Rewrite to the new domain and add "www" RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC] RewriteRule ^/(.*)$ http://www.domain.com/$1 [R=301,L]
These are catch all rules, which check if the host is domain.net, if not it just redirects it to it. (See the motives why you should use "www" or base domains and never both on this page)
In this scenario, if you want to disable rewriting for a certain folder for the .net domain, you can add the following rule at the top of the code:
RewriteRule ^/oldfolder(.*)? - [L] # Rewrite to the new domain and add "www" RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC] RewriteRule ^/(.*)$ http://www.domain.com/$1 [R=301,L]
Here we will match the folder and stop there, thereby serving the page from the alternative domain name (a .net domain) for the specified folder.
http://www.domain.net/oldfolder/somethingelse
If you need more information on www or non-www URL rewriting, please see the www-redirection tutorial page.