I have a website with about 2000 links, and other site with the exact same pages.
I need to know how to do in apache the redirect from one domain to the other one, taking into accounts that after the .com the page will be the same on both sites
Example
User request:
http://www.mydomain.com/product1
Should redirect
http://www.mydomain2.com/product1
It should be a 301 redirect
Thank you for your help
This can easily be done with mod_rewrite:
This to be placed in .htaccess in website root folder (or into Virtual Host context) for http://www.mydomain.com. This also assumes that
www.mydomain.comandwww.mydomain2.comare on different servers / virtual hosts (in other words, not pointing into the same physical folder).