I have a site that I need redirected to another URL (301) with the exception of two items. My .htaccess file looks like this: RewriteEngine on Options +FollowSymlinks RewriteBase / RewriteRule ^view/(.*) redirect.php?view=$1 [R] RewriteRule ^rss.xml$ rss.php [L] Code (markup): I need to keep those rewrite rules active but I need everything else redirected to another url sample.com. Example: User goes to mysite.com/view/123 they still get to see mysite.com/view/123 Example 2: User goes to mysite.com then they go to sample.com
Exclude the view directory in .htaccess with the following code. Put this before your other rules. RewriteRule ^(view)($|/) - [L] Code (markup):