I’m trying to get subdomains working for a web app that i’m working on. I followed this tut http://net.tutsplus.com/tutorials/php/basecamp-style-subdomains-with-codeigniter/ and I was able to get it working locally by adding my urls to my /etc/hosts file and then adding the following to my httpd.config file
<VirtualHost *:80>
DocumentRoot "/Users/username/Sites/snapGiftApp"
ServerName snapgiftapp.com
ServerAlias snapgiftapp.com
<Directory "/Users/username/Sites/snapGiftApp">
Options -Indexes
Options FollowSymLinks
AllowOverride All
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/Users/username/Sites/snapGiftApp"
ServerName snapgiftapp.com
ServerAlias *.snapgiftapp.com
<Directory "/Users/username/Sites/snapGiftApp">
Options -Indexes
Options FollowSymLinks
AllowOverride All
</Directory>
</VirtualHost>
I’m now trying to get it working on my server and i’m unable to get the subdomain piece working. If you go to http://snapgiftapp.com, you see the landing page just fine. If you go to any http://subdomain.snapgiftapp.com, you see an error page.
I’ve added a wildcard subdomain to my dns and i’ve added the following to my httpd.config file and i’m still getting an error when viewing http://subdomain.snapgiftapp.com
<VirtualHost *:80>
DocumentRoot "/home/snapgift"
ServerName snapgiftapp.com
ServerAlias snapgiftapp.com
<Directory "/home/snapgift">
Options -Indexes
Options FollowSymLinks
AllowOverride All
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/home/snapgift"
ServerName snapgiftapp.com
ServerAlias *.snapgiftapp.com
<Directory "/home/snapgift">
Options -Indexes
Options FollowSymLinks
AllowOverride All
</Directory>
</VirtualHost>
What am I doing wrong on the server that this is not working? Do I need to provide the full path for the directory? i.e. /var/www/etc/etc.. ?
Seems that I had my wildcard dns set on the domain name and not on the actual host.