I have to apply a minify actions to any or all the javascript and CSS files, except those I indicate.

I've this problem and rule that is applicable to any or all the files (css and js):

RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*\.)(js|css)$ minify.php?q=$1$2 [L,NC]

I have to add the circumstances to express:

Affect all except: jquery.js, prototype.js, etc..

Do this

RewriteCond %{REQUEST_FILENAME} !^.*jquery.js$
RewriteCond %{REQUEST_FILENAME} !^.*prototype.js$
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*\.)(js|css)$ minify.php?q=$1$2 [L,NC]

The important thing to this is actually the inversion from the regex while using "!" (exclamation point) to express the file title isn't jquery.js and never prototype.js also it can be located on the hard disk.

You should use RewriteCond to specify which conditions the RewriteRule ought to be applied. So prepend wrinkles for your .htaccess:

RewriteCond %{REQUEST_FILENAME} !jquery.js
RewriteCond %{REQUEST_FILENAME} !prototype.js

Many thanks with this! I have been looking with this response to my problem for nearly per month. My problem was how you can rewrite some files to https and also the relaxation to http, however i could modify above to really make it work. Here is a chunk of my code. (I've got a much more files within the real .htaccess on the website.)

#################################################################
# To only change certain files from http to https, the rest from 
# https to http. Absolute links are set up throughout the site, 
# but if a visitor for some reason edits the URL in the address
# bar, the URL will change back to the proper format.

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^alvingolf\.com$ [NC]
RewriteCond %{HTTPS} on
RewriteCond %{SERVER_PORT} ^443$ 
RewriteCond %{REQUEST_FILENAME} !^.*contact-us.html$
RewriteCond %{REQUEST_FILENAME} !^.*register-for-tournaments.html$
RewriteCond %{REQUEST_FILENAME} !^.*form.htm$