title: How can i block direct access to specific folder?
body: <p>There is my problem, i have an img tag, src gets image from icon/ folder and i need to disable direct link access to that folder and content inside that when user type something like 'mywebsite.com/icon/logo.png', using htaccess, but allow content inside src attribute to get and display it without 403 error message 'access denied' in browser console, i made lot of research but nothing helped me, if i missing something please provide your opinions thanks.</p>
  
  <p>my .htaccess code is here:</p>
  
  <pre><code>&lt;IfModule mod_rewrite.c&gt;
  
      &lt;If "%{HTTP_HOST} == 'http://mywebsite.com/icon/'"&gt;
          deny from all
      &lt;/If&gt;
      &lt;Else&gt;
          allow from all
      &lt;/Else&gt;
  
  &lt;/IfModule&gt;
  </code></pre>