I'm getting some troubles with htaccess in my new php project . I couldn't find any solutions so I ask here , hope someone will help me out.
1 . What I need :
On root , urls pointing to existing files and folders are not accessible , except /Public/ and all its folders and files ( only /Public/ is allowed to access ) . Urls pointing to files and folders which are not existings will be redirected to root index.php. /Public/ is redirected to root index.php too , folders and files inside it are not ( direct access ).
2 . What I have tried and are not working :
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_URI} !^/Public
RewriteCond %{REQUEST_FILENAME} !^index\.php$
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule . - [F,L,NC]
RewriteBase /Public/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L,QSA]
</IfModule>
------------------------------------
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_URI} !^/Public
RewriteRule . - [F,L,NC]
RewriteBase /Public/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L,QSA]
</IfModule>
------------------------------------
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule . - [F,L,NC]
RewriteBase /Public/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L,QSA]
</IfModule>
Thank you in advance :)