Apache Rewrite Excluding Assets Directory

Posted by Midiane on Stack Overflow See other posts from Stack Overflow or by Midiane
Published on 2010-04-23T12:10:45Z Indexed on 2010/04/23 12:13 UTC
Read the original article Hit count: 204

Filed under:
|
|
|

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.

© Stack Overflow or respective owner

Related posts about apache

Related posts about mod-rewrite