Startting with some simple domain setup :
<VirtualHost *:80>
ServerName site.com
ServerAlias *.site.com
DocumentRoot /path/to/site.com
<Directory /path/to/site.com>
AllowOverride all
Options -MultiViews
</Directory>
RewriteEngine On
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$ [NC]
RewriteRule . %1/%2 [R=301,L]
RewriteCond %{HTTP_HOST} ^(.*).site.com$ [NC]
RewriteRule ^(.*)$ http://site.com$1 [R=301]
RailsEnv production
</VirtualHost>
So I’m pretty happy, anything put before my domain will be removed and my urls will always be clean : http://site.com
Cool!
** BUT **
I’d like to set a specific subdomain (an exception in that case) which would point to another site on the same server (another folder, another slightly different apache config, etc…)
This setup above will always precedes the one I would do for my ‘exception’ dubdomain.
How could I reach the goal described ? Catch-all apache setup with one (or some more) subdomain setup exceptions ?
Try to add you configuration for desired subdomain above this code, it should help.