title: .htaccess block all php files with the exepction of some files
body: <p>Im trying to make a .htaccess file that blocks every folders and file with the exepction of the folder public, the file index.php, the file ajax.php, img, css and js. It should also redirect you to www.domain.com/index.php no matter what you type in the url. Almost everything is working but the ajax.php file is still blocked so my javascript files cant access it. Any suggestions? </p>
  
  <p>My index.php is placed in the folder public, all other php files is placed in a folder named php, js, css and so on but they are not inside public. its like this /root/public and /root/php and so on. The .htaccess file is placed in /root/</p>
  
  <pre><code>RewriteEngine On
  
  RewriteBase       /
  RewriteCond     %{REQUEST_FILENAME} !-f
  RewriteRule       ^(.*)$    public/index.php?_url=$1    [QSA,L]
  
  RewriteCond %{REQUEST_URI} !^/(?:public/|index\.php$|ajax\.php$|.+\.(?:jpe?g|gif|png|ico|tiff|css|js)$) [NC]
  RewriteRule . - [F]
  </code></pre>