Apache Rewrite Excluding Assets Directory
- by Midiane
Hi all
I'm writing a mini-MVC application. App architecture:
actions/
templates/
site/
app/
styles/
images/
scripts/
So far, I've got a controller working properly, taking in all requests. However, javascript files are not being rendered properly in the browser; I'm getting a 404 Not Found when I try to load the file in the browser.
Here is my current Directory config in a vhost file:
DirectoryIndex index.php
RewriteEngine On
RewriteBase /apps/ecatalogue
RewriteRule ^scripts/(.*) - [NC,L] <--- Rule not working
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [NC,L,QSA]
I can confirm everything else works; I just need apache to ignore anything in scripts so the file can be loaded normally without being processed by the controller.
Your help is appreciated.