Here is my virtual hosts config:
<VirtualHost *:80>
ServerName example.com
ServerAlias *.example.com
Options +FollowSymLinks
RewriteEngine On
DocumentRoot /my/root/directory
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /my/root/directory>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
And here is how my .htaccess file looks:
Options +FollowSymLinks
Options +Indexes
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !example.com$ [NC]
RewriteRule ^(.*)$ http://example.com [L]
You'll notice that I'm rewriting EVERYTHING to http://example.com. This is just a basic test, but all I get when I go to http://test.example.com is this:
HTTP/1.1 302 Found Date: Wed, 09 Nov 2011 05:10:32 GMT Server: Apache/2.2.3 (Red Hat) Location: http://search5.comcast.com/?cat=dnsr&con=ds&url=test.example.com Content-Length: 0 Connection: close Content-Type: text/html; charset=UTF-8
http://example.com is my localhost
I'm running Apache/2.2.17 (Ubuntu)
It works when I add the specific subdomain to my /etc/hosts file, but this defeats the purpose for wildcard subdomains, at least for me. Is there a way to get this to work?
Thanks,
wintermute

New Topic/Question
Reply



MultiQuote


|