We had a similar issue, but took a slightly different approach:
# exclude files from rewriting
RewriteCond %{REQUEST_FILENAME} !-f
# exclude directories from rewriting
RewriteCond %{REQUEST_FILENAME} !-d
# exclude static files, they should throw a 404 if they do not exist
RewriteCond %{REQUEST_URI} !^.*\.(css|js|jpg|gif|png|swf|ico)
# rewrite rules, NS skips rewrite rule for internal sub-requests
# for fw/1
RewriteRule ^(.*)$ /index.cfm/$1 [NS,L]
Basically the same idea, slightly different implementation. Is there
any benefit to using RewriteRule over RewriteCond to exclude the
static files?
On Feb 8, 4:56 pm, Sean Corfield <
seancorfi...@gmail.com> wrote:
> I recommend adding a web server rewrite rule that causes static assets
> to be handled directly by the web server instead of passing them to
> the app server, something like this (for Apache):
>
> RewriteRule ^.*\.(bmp|gif|htc|html?|jpe?g|ico|png|css|js|txt|pdf|doc|xls|xml)$
> - [L]
>
> Sean
>
>
>
>
>
>
>
>
>
> On Sat, Feb 4, 2012 at 6:09 PM, at <
ocon...@gmail.com> wrote:
> > Hi
>
> > The problem ended up being very silly but with lots of headaches.
>
> > I had an inline style sheet including a background image that was
> > causing the application.cfc to be executed twice.
>
> > #footer {
> > height: 84px;
> > //background: url(images/footer.png);
> > }
>
> > thanks,
>
> > anthony
>
> > --
> > FW/1 on RIAForge:
http://fw1.riaforge.org/
>
> > FW/1 on github:
http://github.com/seancorfield/fw1
>
> > FW/1 on Google Groups:
http://groups.google.com/group/framework-one
>
> --
> Sean A Corfield -- (904) 302-SEAN
> An Architect's View --
http://corfield.org/
> World Singles, LLC. --
http://worldsingles.com/