RewriteCondthat checks if the requested file exists:
RewriteCond %{REQUEST_FILENAME} !-f
Great, but that’s not what I was looking for. Instead I needed to Rewrite only if a specific folder existed. The solution turns out to be this:
RewriteCond %{DOCUMENT_ROOT}/path/within/your/project/ -d
You need DOCUMENT_ROOT as the RewriteCond -d checks for the full path
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Recent Comments