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 they are not redirected. If a user goes to mysite.com/rss.xml they see my feeds not redirected. Everything else can be redirected. One more thing the number after view can be anything. So mysite.com/view/123456 still needs to stay with my site and not me redirected. Example 2: User goes to mysite.com then they go to sample.com
Add the following lines: RewriteCond %{HTTP_HOST} !^www.mysite.com$ [NC] RewriteRule ^(.*)$ http://www.sample.com/$1 [L,R=301] Code (markup):