If someone goes to my1domain.com/ or even a page that doesn't exist like my1domain.com/thisplace/does-not?q=exist (so basically anything) I want it all to redirect to the root of another domain, ie. my2domain.com (no www. on redirected domain, but will catch www. or no www. or any subdomain of my1domain.com) Thank you for your help.
Perhaps by placing a meta refresh tag in your 404 error page. <meta http-equiv="refresh" content="0;url=http://my2domain.com"> Code (markup): content="0 means that it will redirect the user automatically right after the browser reads the code.
I want to do it by 301 redirect to be search engine friendly, so preferably .htaccess. To give exact examples: http://mydomain.com/ will redirect to http://otherdomain.com/ http://www.mydomain.com/ will redirect to http://otherdomain.com/ http://www.mydomain.com/anypage.php will redirect to http://otherdomain.com/ http://mydomain.com/anypage.php will redirect to http://otherdomain.com/ http://mydomain.com/someotherthing will redirect to http://otherdomain.com/ http://www.mydomain.com/someotherthing will redirect to http://otherdomain.com/ http://anysubdomain.mydomain.com/ will redirect to http://otherdomain.com/ Basically so that no matter what is typed in on mydomain.com (so http://*.mydomain.com/*) will all redirect to http://otherdomain.com/ Does anyone know how?