I have two domains (a.com and b.com) and a.com is running on my apache server. I want web browsers that try to visit b.com to end up at a.com/?b (transparently, no redirect, and no second virtual host if possible).
I see that within the virtual host config i can rewrite (as shown here) but it's not clear and there are no examples.
Can someone propose the simplest way to solve this, ideally without another virtual host?
UPDATE:
I'm trying to solve it something like this. I think I'm close but a bit lost:
<virtualhost XXX.XXX.XXX.XXX:80>
ServerName a.com
ServerAlias b.com
RewriteEngine On
RewriteCond %{HTTP_HOST} (.*)\b\.com
RewriteRule ^(.*) http://%1a.com/?b [L]
</VirtualHost>