sleddog wrote:
Another method is to simply use Apache's RedirectMatch:
Code:
<VirtualHost *:80>
ServerName mydomain.net
ServerAlias mydomain.co
RedirectMatch permanent ^(.*)$ http://mydomain.com$1
</VirtualHost>
<VirtualHost *:80>
ServerName mydomain.com
# Complete configuration here...
</VirtualHost>
Would redirect all requests for mydomain.net and mydomain.co to mydomain.com
Thanks, I like that approach much better as I dont even need to have a separate directory structure for my extra domains, and my vhost file is much cleaner.