I have an apache vserv with the following configuration:

ServerName www.mydomain.com
ServerAlias www.my-domain.com

Since I want www.mydomain.com to be the only used address I thought about rewriting the URL through .htaccess with Apache's Rewriting Engine. It should redirect all requests to www.my-domain.com/whatever_here to www.mydomain.com/whatever_here. I wrote the following code (without any reactions from apache):

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.my-domain.com$
RewriteRule ^/(.*)$ http://www.mydomain.com/$1 [R]

As I said, this showed simply no result. Whenever I call www.my-domain.com in my browser the website opens up without the URL being rewritten.

Anybody knows why?