If that’s the case, then you REALLY need to learn how to SELECTIVELY capture “everything” because (.*) is a troublemaker!
GOOD to see that you’ve managed to get dynamic virtual hosting setup! That’s an accomplishment.
RewriteCond %{HTTP_HOST} ^([^.]*)\\.venueave\\.com$
RewriteCond %{HTTP_HOST} !^www\\.venueave\\.com
RewriteRule (.*) availability.php?username=%1 [QSA]
[indent][I]If you're not using the $1, use .? to speed-up processing.[/I][/indent]
Reroute ajax calls?
To do this, you’ll need to add two sections to your programming (scripts and/or mod_rewrite):
WHY are you using foo.domain.com/js/ajax.php to link to your AJAX in the first place? Let sanity prevail and use the absolute link to the location you want to fetch the content.
Okay, if that’s not possible, you can fall back on using mod_rewrite to redirect foo.example.com/js/ajax.php calls to js/ajax.php by …
Exclude js/ajax.php from the existing redirection by adding the exclusion
RewriteCond %{REQUEST_URI} !^js/ajax\\.php$
Of course, loosen that up if you’re also using other scripts for AJAX.
You do realize that a website on foo.example.com is not allowed to call a script on [noparse]www.domain.com[/noparse] through AJAX because of the cross domain policy in AJAX right?
There seems to be a workaround for subdomains like you want here. I haven’t tried it though.