Thanks for your suggestion Fernando.<br><br>Surely &#39;if (!-f $request_filename)&#39; performs a stat check to see if the file exists - thereby increasing disk overhead?<br><br>Couldn&#39;t the regexp be reversed to exclude matching &#39;.php&#39;?<br>
<br>Does this make sense:<br><br>location ~ ^/(js|css|images|etc)/(.+)(?&lt;!\.php)$ {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; root /var/www/<a href="http://domain.com/public">domain.com/public</a>;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; access_log off;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; expires max;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br><br>(I know that&#39;s almost certainly incorrect - but is that kind of regular expression possible?)<br><br>Thanks again<br><br><div class="gmail_quote">On Tue, Nov 11, 2008 at 10:35 AM, Fernando Perez <span dir="ltr">&lt;<a href="mailto:lists@ruby-forum.com">lists@ruby-forum.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# &nbsp;DO NOT WANT TO USE THIS METHOD (WHICH WORKS):<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# &nbsp;If the file exists as a static file serve it<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# &nbsp;directly without running all<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# &nbsp;the other rewite tests on it<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;#<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# if (-f $request_filename) {<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# &nbsp; break;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# }<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# if (!-f $request_filename) {<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# &nbsp; rewrite ^/(.+)$ /index.php?q=$1 last;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# &nbsp; break;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# }<br>
&gt;<br>
<br>
I am curious about why you don&#39;t want to use this method. What&#39;s wrong<br>
with it?<br>
<br>
For your regexp problem you can force the accepted extensions too:<br>
<br>
 &nbsp; &nbsp; &nbsp;location ~ ^/(js|css|images|etc)/(.+)\.(png|gif|css|js)$ {<br>
 &nbsp; &nbsp; &nbsp; &nbsp; root /var/www/<a href="http://domain.com/public" target="_blank">domain.com/public</a>;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; access_log off;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; expires max;<br>
 &nbsp; &nbsp; &nbsp;}<br>
<br>
This way php files will not match the regexp and will not get served.<br>
<font color="#888888">--<br>
Posted via <a href="http://www.ruby-forum.com/" target="_blank">http://www.ruby-forum.com/</a>.<br>
<br>
</font></blockquote></div><br>