projectname/<br> application/<br> controllers/<br> views/<br> scripts/<br> library/<br> public/<br> tests/
The public directory contains files that should be given to the user by the web server, therefore it should be installed as a DOCUMENT ROOT. The problem is that some hosters do not provide access to changing this parameter, as well as to directories higher level, i.e. when you connect via FTP, the highest level you can get to is inside DOCUMENT ROOT.
RewriteEngine On<br> <br>RewriteRule ^\.htaccess$ - [F]<br> <br>RewriteCond %{REQUEST_URI} =""<br>RewriteRule ^.*$ /public/index.php [NC,L]<br> <br>RewriteCond %{REQUEST_URI} !^/public/.*$<br>RewriteRule ^(.*)$ /public/$1<br> <br>RewriteCond %{REQUEST_FILENAME} -f<br>RewriteRule ^.*$ - [NC,L]<br> <br>RewriteRule ^public/.*$ /public/index.php [NC,L]
Source: https://habr.com/ru/post/63053/