cd into home, and then ls -l, and make a note of the username and groupname for ‘mydomain’.
Then cd into mydomain, and then ls -l, and make a note of the username and groupname of public_html. The username should be the same as that for home, but the group name should be ‘nobody’. This is where the 404 occurs if not ‘nobody’ I think.
Then cd into public_html, and then ls -l, and all the file users and groups should be the username and groupname set for home.