@ervin.williamson
To write an .htaccess file that manages multiple domains, you can use the RewriteCond and RewriteRule directives. Here's an example of how you can set it up:
1 2 3 4 5 6 7 8 9 10 |
RewriteEngine On RewriteBase / # Domain 1 RewriteCond %{HTTP_HOST} ^(www.)?domain1.com$ [NC] RewriteRule ^(.*)$ http://www.domain1.com/$1 [L,R=301] # Domain 2 RewriteCond %{HTTP_HOST} ^(www.)?domain2.com$ [NC] RewriteRule ^(.*)$ http://www.domain2.com/$1 [L,R=301] |
This example assumes that you want to redirect both "www.domain1.com" and "domain1.com" to "www.domain1.com", and similarly for "www.domain2.com" and "domain2.com". You can modify the code as needed to fit your specific requirements.