I have used FallbackResource /index.php in htaccess to re-route every call to index.php
it works very fine and I am getting the result that I wanted, but I need one directory to access and that directory also re-routes to index.php. How can I achieve this.
For disable routing fallback inside one directory use disabled
keyord (Apache 2.4.4 and later).
<Directory /var/www/path/to/disabled/dir>
FallbackResource disabled
</Directory>
In case of .htaccess files use FallbackResource disabled
inside this dir.
FallbackResource
doesn't support exclusions like this. You can use mod_rewrite
as an alternative.
You can use this rule in your DOCUMENT_ROOT/.htaccess
file:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule !^exclude index.php [L,NC]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With