Getting redirects working in apache
Been down for a while, reconfiguring apache. I got the automatic domain thing working now so I can make all the subdomains I want and apache will automatically redirect to them.
Of course I managed to screw it up somehow and had some sort of redirect loop going on. I just redid everything and it seems to be working now. I had been playing around with RedirectMatch and different configurations in httpd.conf and think I had some conflicting info somewhere, so resorted to a backup and stepped back through setting up the virtual servers. Used this site http://www.megalinux.net/archives/649.html as my guide.
To make the virtual servers work really nicely and not have to set multiple ones up in apache do it like that site says:
These are the steps from the site but subsituted with what I needed to use.
Step 1: Configure wild-card DNS, so that *.sunfire.mydomain.home is a CNAME to sunfire.mydomain.home
Step 2: Configure apache. Create a new virtualhost section for *.sunfire.mydomain.home, like:
VirtualHost *
ServerAlias *.sunfire.mydomain.home
CustomLog /www/logs/subdomains.sunfire.mydomain.home-access_log combined
ErrorLog /www/logs/subdomains.sunfire.mydomain.home-error_log
VirtualDocumentRoot /www/%0
VirtualScriptAlias /www/%0/cgi-bin/
/VirtualHost
Step 3: Restart apache to activate the new configuration
Step 4: Now, say you need blog.sunfire.mydomain.home, all that is required is to create these two directories
/www/blog.sunfire.mydomain.home/
/www/blog.sunfire.mydomain.home/cgi-bin/
Put the pertinent files in them and you can access them without having to restart apache
To do: Setup a redirect from domain.com to www.subdomain.com.
