I have a problem when configuring .htaccess for different folders. I have the folder structure mentioned below.
root/
|-- resources/
|-- config/
|-- libraries/
|-- admin/
| |-- resources/
| |-- config/
| |-- libraries/
| |-- index.php
| |-- .htaccess
|-- index.php
|-- .htaccess
I need to configure the htaceess for the root and admin folder. I need the .htaccess from the root to ignore the admin folder, but when the url has admin folder it should use the .htacess file from the admin folder. For example
www.domain.com/person/add
www.domain.com/person/edit/1
www.domain.com/person/view/1
should use the .htaccess file from the root. When the url has admin folder it should use the .htaccess file from the admin folder. For example
www.domain.com/admin/person/add
www.domain.com/admin/person/edit/1
www.domain.com/admin/person/view/1
The below is the root .htaccess file that I configured.
RewriteEngine On
RewriteCond %{REQUEST_URI} !^(admin)
RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
But it doesn't work for the admin folder. How to configure the .htaccess file for both root and the admin folder.