Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a web site hosted in a CentOS 5-Plesk-Apache server. I have recently added a second site to the server for serve dynamic content. I have established rewrite rules for images (static content) that works pretty well. The module rewrites the URI in the static server to pointing to the the original file.

The problem is that the first site has the minify ( script installed but i cannot realize how to write a modwrite rule that works, so if I have:

<style src=''>

somewhere, this becomes in the file with this URL

Any ideas? Thank you in advance

share|improve this question
up vote 2 down vote accepted

If you don’t want a redirect, you could use a proxy to request that resource internally and pass just the response to the client:

RewriteEngine on
RewriteCond %{HTTP_HOST}
RewriteRule ^/min/f=.+{REQUEST_URI} [P]
share|improve this answer
That is what i need. Thank you (and joschi too)!!! – jab Sep 16 '09 at 12:28

You could easily use either mod_alias's directive RedirectMatch or mod_rewrite for your problem.

A possible rewrite rule (untested) could be:

RewriteEngine on
Options +FollowSymLinks +SymLinksIfOwnerMatch
RewriteRule /min/f=(.*)$$1 [L]
share|improve this answer
That rule seems to provoke a redirection (returns a 302 code) that provokes a new GET – jab Sep 16 '09 at 9:08
Of course you are right. I forgot the P flag to proxy the request. See Gumbo's answer. – joschi Sep 16 '09 at 11:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.