Addon domains accessible from main domain

verdeeee

Registered
Jul 20, 2022
3
1
3
Italy
cPanel Access Level
Website Owner
Hello, please help :)

I have 2 addon domains, lets call them addon1.com and addon2.com, and I respectively pointed them to /public_html/addon-domains/addon1.com and /public_html/addon-domains/addon2.com.

The main hosting plan domain we'll call main.com.

So I can access addon1.com and addon2.com content from respectively https://main.com/addon-domains/addon1.com and https://main.com/addon-domains/addon2.com.

How do I make the content in addon-domains/addon1.com and addon-domains/addon2.com accessible respectively from addon1.com and addon2.com and not from main.com (the main domain).

Thank you so much in advance!
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
11,731
1,864
363
cPanel Access Level
Root Administrator
Hey there! I would expect both methods to work - since the addon domains are virtual domains in a subfolder, domain.com/addon_folder and addondomain.com would both lead to the same content.

If that isn't working, I would start by checking the DNS for the addon domains to ensure things are pointed to the correct IP.
 

verdeeee

Registered
Jul 20, 2022
3
1
3
Italy
cPanel Access Level
Website Owner
I would expect both methods to work - since the addon domains are virtual domains in a subfolder, domain.com/addon_folder and addondomain.com would both lead to the same content.
Hi
The problem is I don't want addon1.com and addon2.com to be accessible from a folder of main.com.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
11,731
1,864
363
cPanel Access Level
Root Administrator
As far as Apache is concerned, it just sees another directory and shows that content. One possible workaround would be custom .htaccess rules to restrict the URL path inside the addon directory, but you'd have to test that out to make sure it doesn't interfere with your site content or other redirects that may be in place.