Multiple domains - One public_html

NORXND

Verified User
Joined
Feb 24, 2021
Messages
16
If I have multiple domains, how can I point them all to one public_html? (Apache server)
 
I just want two domains to use one public_html. Not any kind of redirection.
 
You could use a symlink.
home/domains/domain-A/public_html <-- is the dir you want.
Create a symlink between home/domains/domain-B/public_html and home/domains/domain-A/public_html

Do this as well for the private_hmtl directories.
 
You could use a symlink.
home/domains/domain-A/public_html <-- is the dir you want.
Create a symlink between home/domains/domain-B/public_html and home/domains/domain-A/public_html

Do this as well for the private_hmtl directories.
Thats it! How can I do that?
 
Domain alias is not a redirect, it'd open the same website when accessed, unless it's your CMS or .htaccess sending a redirect.
 
Domain alias is not a redirect, it'd open the same website when accessed, unless it's your CMS or .htaccess sending a redirect.
@smtalk I just set up domain pointer, go to website and then I see that I have my "base domain" in browser not this pointed one
 
Upload some txt file and try accessing it then :) If that's your CMS - whatever you do will result in redirect. Also, when you create the pointer, make sure "Create as an Alias" is selected (this is what I've meant with "alias" in my previous post).
 
Ok. I have solved it. Created one folder (with public_html, private_html etc.) then created a symlink for every domain. Thanks, @Wanabo for the help!
 
Nah...as long it will work it will be good.
Its a hack. Apache tells the request to go look one place and then it gets redirected to another place. Its an extra step for each request. Pointers are the correct way. No extra steps. Its not the DirectAdmin way. Its the correct way. DirectAdmin calls them pointers but what it does is the correct way to have multiple domains point (Pointers) to the same web site. You just want to make sure to "Create as an Alias"

I am saying this not for just you but anybody else that comes along months or years later.
 
Its a hack. Apache tells the request to go look one place and then it gets redirected to another place. Its an extra step for each request. Pointers are the correct way. No extra steps. Its not the DirectAdmin way. Its the correct way. DirectAdmin calls them pointers but what it does is the correct way to have multiple domains point (Pointers) to the same web site. You just want to make sure to "Create as an Alias"

I am saying this not for just you but anybody else that comes along months or years later.
So If I will "Add Alias", it will not just redirect to main domain?
And It will have SSL?
 
You can't have ssl for pointers.

So Zhenyapan's suggestion would be best.
 
Last edited:
Its a hack. Apache tells the request to go look one place and then it gets redirected to another place. Its an extra step for each request. Pointers are the correct way. No extra steps. Its not the DirectAdmin way. Its the correct way. DirectAdmin calls them pointers but what it does is the correct way to have multiple domains point (Pointers) to the same web site. You just want to make sure to "Create as an Alias"

I am saying this not for just you but anybody else that comes along months or years later.
I tried pointers. I set it up for my main domain (which leads to my site) but when I enter pointed domain it redicts me to the site that my hosting provider puts by default (something like there is no site yet. Upload it to public_html)
 
Norxnd, i presume that you have setup your DNS records correctly for the domains that you want to lead to your main site - all pointing to your main domain?
Cheers
Neil
 
Back
Top