Sub domain to sub folder DNS help!

Hi guys,

I came across this problem…

How do I use DNS configurations to point a sub-domain to the main-domain’s sub-folder?

Right now, the sub-domain is going to its own account, instead of going to a folder within the main-account.

WHM (cPanel) has this option and can be setup automatically, but Plesk doesn’t seem to have it. It requires me to manually configure the DNS which I have no idea how to…

Please help!


This isn’t true, and where a domain is hosted isn’t determined by DNS configuration but by the web server configuration.

In Plesk, you go to the main domain, then click the subdomains icon and add the subdomain. It puts the subdomain’s files in /var/www/vhosts/, as well as adding the subdomain’s DNS record.

Thank you for the prompt reply! I found the link you mentioned. But, is there anyway, that the subdomain will not be its own account? I would love it to be just pointing to a subdirectory.

I would like the subdomain be in something like:


Two choices:

  1. Add the DNS entry (you just need an A record pointing to your server’s IP) yourself, and edit httpd.conf to add the VirtualHost entry to point the subdomain to a directory.

  2. Make /var/www/vhosts/ a symlink to /var/www/vhosts/ (ln -s).

I can’t access the httpd.conf even with SSH so I’m left with option #2.

I did a:

ln -s /var/www/vhosts/ /var/www/vhosts/

For some reason it creates a folder:

and the symbolic link didn’t work out.

But the main concern is, between the 2 admin software, there seems to be a huge difference in setting up subdomains.
In cPanel, subdomain is just an masked alias that goes to a folder inside the main domain’s “public_html”,
but in Plesk, subdomain is an actual account in which has its own “mail”, “stats”, “config”, and its own “httpdocs”.

I have also checked both websites’ DNS zones.
In cPanel, the main domain will have a line for the subdomain:
“www.subdomain / A /”

In Plesk, it’d have: / A /”

I wonder, if there’s anyway that in Plesk, the subdomain is just a simple alias that short-cuts to a folder, instead of an entire account.



I have contacted Media Temple and so far none of them techs know how to set it up the cPanel way…

Did you delete the sub/httpdocs directory before trying to create a symlink there?

They see the “subdomain” as a different account than the “main domain” so… I got a biggo erro:

You do not have permission to access this document.

That’s after I followed your instruction with:
[root ~]# rm -rf /var/www/vhosts/
[root ~]# ln -s /var/www/vhosts/ /var/www/vhosts/

I’m very sorry, I DO have access to httpd.conf, and this is what I did:

<VirtualHost *:80>
DocumentRoot /var/www/vhosts/
RedirectMatch 301 (.

Doesn’t seem to work… Since I’m not quite sure what my “root directory” is, I also tried:
DocumentRoot /var/www/vhosts/
DocumentRoot /var/www/vhosts/
DocumentRoot /var/www/vhosts

Nothing happens.

You’re root, you decide permissions. chown the directory?

Doesn’t seem to work… Since I’m not quite sure what my “root directory” is, I also tried:

You’re trying to make it /var/www/vhosts/ That’s the root of the website you want to serve on the subdomain, that’s the DocumentRoot.

I don’t understand the RedirectMatch. Why are you trying to redirect all requests to the main domain instead of the /sub directory?

I donno… I’m just trying to do a wildcard subdomain thing. I searched other websites but my understanding of this concept is limited.

What I’m trying to do is: will read files from will read files from will read files from


I already edited the DNS zone with:

*, A,

I guess now I just need to edit my httpd.conf with the right code?

Can you do proper nameserver to your domain…i think problem of the DNS!