I believe that it is quite normal for a website to have staging for client review and it'd be faster if cpanel could automate this creation for me. Or if you have better approach, please share with me. Many thanks

Thanks. I would like to ask why a subdomain could not have a /public_html since a subdomain is just like a normal main domain where you could have any folder structure as long as vhost is set up in accordance.

Besides, since I am very new to CPanel, if you could help me write a Perl script hook, I'd be so grateful.

Thanks. I would like to ask why a subdomain could not have a /public_html since a subdomain is just like a normal main domain where you could have any folder structure as long as vhost is set up in accordance.

Click to expand...

That is just how things are laid out and is a common mistake for new users ....

Maybe this will help ...

The location where your web root (http://www.yourdomain.com/) is
physically stored on the server hard drive for your main domain is as follows:

/home/(login)/public_html/

The location where the subdomain (http://sub.yourdomain.com/) is
physically stored on the server hard drive is as follows by default:

/home/(login)/public_html/(subdomain)/

When you login to an account by FTP using the MASTER login for the
account, it places you in your UNIX home folder but that is not where
your web root is located so you are forced to change to /public_html
after you connect with FTP:

FTP with the master login puts you in: /home/(login)

(Thus you need to change to "public_html" .... /home/(login)/public_html)

However, when you login with the FTP login created for a subdomain on
the same account, you are already put immediately into the web folder
for the subdomain in /home/(login)/public_html/(subdomain) thus there
is no need to change to any different folder before uploading files.

When connecting with a FTP login for a subdomain, you are already at:

/home/(login)/public_html/(subdomain)

If you were to create a public_html folder under a subdomain,
those files would be accessed on the web as follows: