Hi, I have configured name-base virtual hosting with two domains. DOMAIN.COM DEV.DOMAIN.COM I have configured the first host in ‘httpd-vhosts.conf’ exactly as follows (read the comments): <VirtualHost *:80> # ServerName is absent to default to the "main" server configuration # in ‘httpd.conf’ for requests that do not match any particular virtual # host listed below. </VirtualHost> This way ANYCRAP.DOMAIN.COM goes to a common “why are you here page.†The domains in 1 -4 below are directed (and function) appropriately for: HTTP://DOMAIN.COM HTTP://WWW.DOMAIN.COM HTTP://DEV.DOMAIN.COM HTTP://WWW.DEV.DOMAIN.COM The problem is with HTTPS://ANYCRAP.DOMAIN.COM. I have configured ‘httpd-ssl.conf’ for DOMAIN.COM, which works fine. What I would like to do is have: HTTPS://DOMAIN.COM HTTPS://WWW.DOMAIN.COM resolve to the secure pages and HTTPS://ANYANDALLCRAP.DOMAIN.COM redirect to the same aforementioned “why are you here page.†I tried using the Apache Module mod_rewrite module, but without success. Here is what I tried: # if port 443 (https) RewriteCond %{SERVER_PORT} ^443$ # if it doesn’t start with domain.com doesn’t start with www RewriteCond %{HTTP_HOST} !^www\.domain\.com [NC] # and if its not the main domain RewriteCond %{HTTP_HOST} !^domain\.com [NC] # use port 80 (http) RewriteRule %{SERVER_PORT} ^80$ # resolve requests to this file RewriteRule (.*) /usr/local/www/vhosts/default/htdocs/index.html Ideas please. FreeBSD 8.0-RELEASE Apache-2.2.15_9 Files used in Apache configuration: /usr/local/etc/apache22/httpd.conf /usr/local/etc/apache22/extra/httpd-default.conf /usr/local/etc/apache22/extra/httpd-vhosts.conf /usr/local/etc/apache22/extra/httpd-ssl.conf
Actually, there are 3 domains, the default domain, a.k.a ANYCRAP.DOMAIN.COM, and the 1 & 2 listed in the original post.