chmod all .htaccess files under all website dirs under public_html dir
Instead of manually scanning each files and directory and testing if they are a directory using pushd, I would directly try to target .htaccess files using find:

find "$HOME"/public_html/*.{com,co.il} -name ".htaccess"


Then, to apply the proper permissions, you can use the -exec option of find:

find "$HOME"/public_html/*.{com,co.il} -name ".htaccess" -exec chmod 644 {} \;