httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Hanson>
Subject [users@httpd] Creating Wildcard Sub Domain Using Apache VirtualHost
Date Mon, 26 Nov 2012 17:49:13 GMT
Dear All,

I want to have this configuration on my server :

1. if user request using this URL : or, user
will see index.php in this directory /home/admin1/public_html/

2. but when user request using other sub domain (wildcard) for example :, user will see index.php in this path :

any sub-domain requested will be satisfied with index.php in this path :

technical support on my hosting suggest me to use this method :

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.

nearly close to what I need is this method :

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
<VirtualHost xx.xx.xx.xx:80>
DocumentRoot /home/admin1/public_html

## Here's what I'm trying to add
<VirtualHost xx.xx.xx.xx:80>
    ServerName *
    DocumentRoot /home/admin1/public_html/uweb/%0

please note, I also add DNS record using cPanel :
NAME : *
TTL : 14400
RECORD : X.X.X.X (my server's IP)

View raw message