I manage several domains on a dedicated server. Many customers buy multiple versions of domains to ensure no competitor snatches them up.
They ask me on the best way to forward them to the main domain.
Often I simply add a rewrite role into the virtual host entry such as:
RewriteRule ^/(.*) http://www.domain.com/$1 [L,R=301]
However, I am not really sure on best practice so that it would indexed as well in a search engine or at least does not penalize them.
So is it better to do a index.html file with a meta redirect, php redirect, etc.
What is the most compliant way to forward from lets say
www.domain.com where the main website is located.