In code, my real question is:

if(file_exists( c/ $requesturl ) 
serve( c/ $requesturl )
serve( index.php?blah )

In human form:

My script creates CSS. This really is pretty intensive, and so i built-in caching.

People request:

That is rewritten:

RewriteRule ^([a-zA-Z0-9\-]*)\.css$  index.php?cssfilename=$1&generate

This works. Following the above is visited, a cachefile is produced, that also works:

http:// /c/ 1lfi4wg.css2

Now I wish to serve the produced file (/c/*) because the original request. Now i do that within the php file itself, however i guess carrying this out with htaccess is faster.

Now i have this which doesn't work:

RewriteRule ^(.*)\.css$ %{DOCUMENT_ROOT}/c/$1.css [L]

REQUEST_FILENAME already is definitely an absolute file system path. Try the URI path in REQUEST_URI or even the matched up string from the RewriteRule pattern rather:

RewriteRule ^.*\.css$ %{DOCUMENT_ROOT}/c%{REQUEST_URI} [L]
# OR
RewriteCond %{DOCUMENT_ROOT}/c/$0 -f
RewriteRule ^.*\.css$ %{DOCUMENT_ROOT}/c/$0 [L]