Thank you for visiting the Rackspace Community
The The Community is live! Post new content or topics so our teams can assist.

Please contact your support team if you have a question or need assistance for any Rackspace products, services, or articles.

htaccess redirect rules don't work

Hello! I'm new to htaccess so don't judge me please :).
I have the following problem - I'm making a website in my local server /it's apache2/ and the project is located in the www/html/subFolder/MVC.
In the MVC folder I have the following structure
MVC
|-- .htaccess
|-- app
||-- bootstrap.php
||-- .htaccess
||-- config
||-- controllers
||-- helpers
||-- libraries
|||-- controller.php
|||-- core.php
||`-- database.php
||-- models
|`-- views
`-- public
|-- .htaccess
|-- css
|-- img
|-- index.php
`-- js

The problem is that I try to make a redirect rule for the public folder. For example when the user try to open MVC/public/test.php /some file that doesn't exist/ it should redirect it to the MVC/public/index.php, but my rule doesn't work
Here is my htaccess file in the public folder
<IfModule mod_rewrite.c>

 Options -Multiviews
 RewriteEngine On
 RewriteBase /MVC/public
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
</IfModule>


And here is my htaccess in the root folder
<IfModule>
 RewriteEngine on
 RewriteRule ^& public/ [L]
 RewriteRule (.*) public/$1 [L]
</IfModule>