subdomein -> DocumentRoot

carootje

New member
Joined
Jan 22, 2008
Messages
1
I have a question:

-I have a view subdomains: sub1.domain.com and sub2.domain.com.
-I have a source files: www.domain.com/src

Now I would like to point all subdomains to the www.domain.com/src files.

I have tried to do it with VirtualHost with Direct Admin:

ServerName *.domain.com.
ServerAlias *.domain.com.
DocumentRoot /home/domain/domains/domain.com/public_html/src

But it won't work :(

Can anybody help me?
 
I have a question:

-I have a view subdomains: sub1.domain.com and sub2.domain.com.
-I have a source files: www.domain.com/src

Now I would like to point all subdomains to the www.domain.com/src files.

I have tried to do it with VirtualHost with Direct Admin:

ServerName *.domain.com.
ServerAlias *.domain.com.
DocumentRoot /home/domain/domains/domain.com/public_html/src

But it won't work :(

Can anybody help me?
This looks like you're going to have to do a redirect, either with DNS, Apache, or PHP.

If you're doing a redirect, do a 301 with Apache (.htaccess) modrewrite or PHP:
How to do a 301 redirect - this site contains how to do a 301 redirect with .htaccess modrewrite, PHP, and many other coding languages..

As for DNS, I am not sure how to do this...I know it has something to do with domain forwarding or domain redirect so search Google for that. :o I'd ideally suggest just doing a 301 redirect though..
 
Back
Top