How can I forward short-dom.com to long-domain.com ?
I keep seeing examples like:
RewriteCond %{HTTP_HOST} ^a\.com$ [NC]
RewriteRule ^(.*)$ http://www.a.com/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^b\.com$ [NC]
RewriteRule ^(.*)$ http://www.b.com/$1 [L,R=301]
But these don’t allow me to specify my short domain (all combinations of it – with or without www.)…
In the examples in your question, the place you specify the domain is on the line that says RewriteCond.
For example, this condition
will match if the host name in the http request (%{HTTP_HOST}) matches the regular expression that follows. Your examples will match “a.com” while mine will match “old.example.com”.
The line that says RewriteRule will do the actual rewriting. In your example it will replace
with
by substituting the regular expression matched with a new URL.
^(.*)$matches the entire request and$1substitutes it in the new URL.