In PHP and apache web server to prevent from listing and browser showing as i know we can use .htaccess
Deny from all
or using index.html
file
<html>
<title>403 Forbidden</title>
<body>
Directory access forbidden!
</body>
</html>
which is better then both approaches? in security and speed access to show the error or there is another approach better then both approaches