How to redirect any variable(string) to another http://domain2.com/ from http://domain1.com/ First when user enter domain1.com user can view this website domain1.com/ After loading domain1.com/ If user type in address bar "http://popcorn" "http://go"or user should redirect to domain2.com/. What I want when user enter domain1.com & after loading, if user type variable(string) inluding "http://" he should redirect to domain2.com How to write rewrite rule for the above example.
Use the below code RewriteEngine on RewriteCond %{HTTP_HOST} ^domain1.com$ RewriteRule ^(.*) http://domain2.com/$1 [L,R=301] Code (markup):