I have been trying to find a method to redirect all directories except a few to a file with a variable
Example:
site.com/test -> index.php?a=test
I want all subdirectories to be forwarded except for the following
/images
/admin
/includes
I have tried the following withough success.
RewriteCond %{REQUEST_URI} !^/images(/|$)
RewriteCond %{REQUEST_URI} !^/admin(/|$)
RewriteCond %{REQUEST_URI} !^/includes(/|$)
RewriteRule ^([\w/]*)$ index.php/?a=$1 [L]
Is there a way to complete this using .htaccess
EDIT:
I found this which is closer to what im looking for but it needs to be updated to allow access to /images /admin /includes.
Options +FollowSymLinks -MultiViews
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php?a=$1 [NC,L,R=301]
In .htaccess you can use this rule
In your application you can get $_SERVER["REQUEST_URI"] and manipulate as you whish!