How our FTP was setup, the root level is Website #1.  Website #2 has it's own directory folder inside that root.Both websites refer to the same .htaccess. If I do Redirect 301 /example/ http://www.website2.com/example/, there will be a redirect loop.It will redirect http://www.website1.com/example/ to http://www.website2.com/example/.Then also redirect http://www.website2.com/example/ to http://www.website2.com/example/(which creates the redirect loop)What I want is to somehow only redirect http://www.website1.com/example/ to http://www.website2.com/example/ without creating the redirect loop.NOTE: I do NOT want every webpage on Website#1 to redirect to Website#2.  Just that specific URL to the new URL.
Redirect loop from two domain using the same .htaccess
htaccess;redirects;301 redirect
You'll need to use mod_rewrite (as opposed to a mod_alias Redirect) and check the HTTP_HOST server variable (which tells you which site has been accessed). Something like the following at the top of your .htaccess file:RewriteEngine OnRewriteCond %{HTTP_HOST} ^(www\.)?website1\.com$ [NC]RewriteRule ^example/(.*)$ http://www.website2.com/example/$1 [R=302,L]Change the 302 (temporary) to a 301 (permanent) redirect if you need a permanent redirect, but only after you have tested to make sure it's working OK. (301 redirects are cached by the browser so can make testing problematic - unless you test with the browser cache disabled.)This redirects /example/<something> to http://www.website2.com/example/<something>, in much the same way as the original Redirect directive would do (which is prefix matching).UPDATE: To redirect just the homepage, ie. http://www.website1.com/ to http://www.website2.com/, you can use something like the following:RewriteCond %{HTTP_HOST} ^(www\.)?website1\.com$ [NC]RewriteRule ^$ http://www.website2.com/ [R=302,L]Note the RewriteRule pattern ^$ - this matches the empty URL (ie. the homepage only). (Note that the URL matched by the RewriteRule pattern is less the directory-prefix.)