This should never be the case as your public path for your web server should be set to web/ making config and more importantly, .env, not publicly viewable.
Problem is that its hosted on WHM/cPanel and I haven’t found out how to change document root from public_html to public_html/web. I’ve searched and searched bout found no real solution to that.
Am currently having to use a .htaccess in public_html