How to restrict access to Addon Domain through Main Domain so that the contents are not visible from folder view? [Important| Updated June 2019]
Most of our Clients ask us how to hide the Main domain from the URL if anyone wants to access their Addon Domain.
To be more clear let me take an example to brief you, suppose you created any Addon Domain then the actual path of your Addon Domain will be maindomain.com/addon_domain.com because addon_domain.com is literally a directory in your main domain. So now if you want to hide the main_domain from the URL you have to use htaccess rule to deny urls starting with /addon_domain.com.
The following htaccess’ code which when applied in htaccess file inside Addon Directory will generate 404 Error “Page Not Found” if someone wants to access Addon domain through Main domain in the URL tab.