I am using following rules which skips files if paths to them is already provided.
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^$ public/index.php [NC,L]
RewriteCond %{REQUEST_URI} !^/public/
RewriteRule ^(.+)$ public/index.php?r=$1 [L,QSA]
But this makes me, to access the files like site.com/public/js/somefile.js
, which is not intented.
Can we check if file exists inside a directory and rewrite the url so to access it as `site.com/js/somfile.js"
RewriteCond %{REQUEST_FILENAME} -"public/"f
RewriteRule ^ - [L]
Obvioulsy this didn't work. Any ideas?
Right before this rule:
Add this rule: