Symfony protect all directory by direct access
<p>I have on a server a Symfony project with an API and my IP is configured for redirect to <code>/var/www</code> => index.html.</p>

<p>But in my browser, I can access whole project directory with this url for example : <code>http://MY_IP/MY_SF_PROJECT/</code></p>

<p>What's the best way to protect my whole project for direct access ? I want to continue to access to my web folder but not the whole folder.</p>