<?xml version="1.0" encoding="UTF-8"?>
<post>
  <body>In preparation for working on the "prologblog.com":http://prologblog.com CSS, I wanted to change my Apache config to serve static files like CSS and JavaScript before those requests got passed to the Prolog application.

Adjusting the rewrite rules I was already using for a Rails application, I changed the Prolog Blog config to use this:

&lt;div class="CodeRay"&gt;&lt;source:plaintext&gt;
# Redirect all non-static requests to Prolog
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule ^/(.*)$ http://127.0.0.1:8000%{REQUEST_URI} [P,QSA,L]
&lt;/source&gt;&lt;/div&gt;
&lt;br/&gt;and I was then able to remove my Proxy commands I "used originally":http://jeff.dallien.net/posts/apache-reverse-proxy-to-swi-prolog:&lt;div class="CodeRay"&gt;&lt;source:plaintext&gt;
ProxyPass / http://127.0.0.1:8000/
ProxyPassReverse / http://127.0.0.1:8000/
&lt;/source&gt;&lt;/div&gt;
&lt;br/&gt;Does anyone know any reason why having the rewrite rule do all the proxying work wouldn't be the best way? It has been working fine, but I was surprised by the fact that now no proxy commands are required.
</body>
  <created-at type="datetime">2009-03-20T17:59:00-04:00</created-at>
  <id type="integer">45</id>
  <published type="boolean">true</published>
  <title>Serving static files without proxying</title>
  <updated-at type="datetime">2009-03-20T19:00:08-04:00</updated-at>
  <url-title>serving-static-files-without-proxying</url-title>
</post>
