I want all newly created domains to use a private_html link, pointing to public_html


Enter Your Query:
Use '%' for wildcards and quotes for "exact phrases"


Top Level » DirectAdmin » Custom Scripting

I want all newly created domains to use a private_html link, pointing to public_htmlLast Modified: Sep 19, 2017, 1:33 am
This guide is no longer needed.  As of DirectAdmin 1.52.0, there is a new option that can set a link instead of a folder, by default:
https://www.directadmin.com/features.php?id=2023



OLD
If the bulk of your new domains don't need a separate private_html folder, you might want to link the private_html to public_html by default.

You can do this by creating this custom script:

/usr/local/directadmin/scripts/custom/domain_create_post.sh

In that script add the following code:

#!/bin/sh
D=/home/$username/domains/$domain
PH=$D/private_html

if [ -d $PH ]; then
   rm -rf $PH
   ln -s public_html $PH
   chown -h $username:$username $PH
fi
exit 0;

save/exit, and chmod the script to 755:

chmod 755 /usr/local/directadmin/scripts/custom/domain_create_post.sh



After this is set, any new domain will use a link from private_html to public_html.

The User can still change it back to a domain by going to:

User Level -> Domain Setup -> domain.com

and un-checking the private_html link option, at the bottom.

© 2018 JBMC Software, Suite 173  3-11 Bellerose Drive, St Albert, AB  T8N 1P7  Canada.  Mon-Fri 9AM-5PM MST