Forum Moderators: phranque
I am curious if it's possible to create a subdomain or something that will act as one in Apache. For instance, CPanel creates subdomains without touching the domain.
Currently, I create A record subdomains and point them to my server IP. Then I setup the virtual host in apache to recognize that subdomain and redirect it to its relative folder.
I was hoping for something a little more organized or at least easier so that apache can look for any sort of "subdomain" part to the entered url, then redirect to the specified page. Going to my domain manager and creating A records each time seems to be the improper way, but if that's the only way, then that is the only way. I did read somewhere that when you create a folder in your document_root, it automatically redirects to that folder when you enter the folder name as a subdomain. I do think that that was a feature specifically for that web hosting company.
If this question has been answered elsewhere, a link would be helpful as I was unable to find anything after searching.
Any help is greatly appreciated!
Thanks.
Calzinger.
See:
[httpd.apache.org...]
For example, if you have the following in your config..
VirtualDocumentRoot /var/www/virtualroot/%0
..then, you can serve www.example.com simply by uploading a website to:
/var/www/virtualroot/www.example.com/
dito any other host, all without any re-configuration of your server. Combine this with wildcard DNS and I think you have what you're looking for...