0

I know that the AddHandler directive allows you to associate a file extension with a a process.

Is it possible to associate a single file with a process?

For example, I would like to process something.css go run a PHP script to generate some CSS dynamically.

From what I have read so far, it might be possible using something like:

<Files something.css>
    # go off to PHP script
</Files>

… but I don’t know what to do next.

Manngo
  • 14,066
  • 10
  • 88
  • 110

1 Answers1

0

OK, here’s how I got it working:

#   .htaccess
    <Files something.css>
        RewriteEngine On
        RewriteRule ^(.+)$ /styles/something.php [QSA,L]
    </Files>

This goes directly into the /styles/ directory, since you can’t specify directories in the Files directive.

Manngo
  • 14,066
  • 10
  • 88
  • 110