Creating Wildcard Sub Domain Using Apache VirtualHost
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Dear All,
I want to have this configuration on my server :
1. if user request using this URL :
example.com or
www.example.com, user will see index.php in this directory /home/admin1/public_html/
any sub-domain requested will be satisfied with index.php in this path : /home/admin1/public_html/uweb/***.
example.com
based on that tutorial, the PHP now has a new job... to redirect on specific folder when user request with sub domain. I don't like this method. for me, it would be better if Apache can handle this.
but, I have a problem with VirtualHost setting, how to create VirtualHost correctly for that situation?
here's what I've done but didn't work :
## I think this one is for www or without www, automatically generated with WHM
<VirtualHost xx.xx.xx.xx:80>
DocumentRoot /home/admin1/public_html
</VirtualHost>
## Here's what I'm trying to add
<VirtualHost xx.xx.xx.xx:80>
DocumentRoot /home/admin1/public_html/uweb/%0
</VirtualHost>
please note, I also add DNS record using cPanel :
TTL : 14400
CLASS : IN
TYPE : A
RECORD : X.X.X.X (my server's IP)
[Index of Archives]
[Open SSH Users]
[Linux ACPI]
[Linux Kernel]
[Linux Laptop]
[Kernel Newbies]
[Security]
[Netfilter]
[Bugtraq]
[Squid]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Samba]
[Video 4 Linux]
[Device Mapper]