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

Is it possible the following scenario: I want to access a third-party site through my web server. Is it possible in the middle to rewrite all request to the third party .CSS files to files on my server?

share|improve this question
up vote 1 down vote accepted

Yes, though it will be YOUR web-server doing the fetching not the client. Doing so in a badly configured way opens you up to being an open-proxy on the net which is a Bad Thing. Unless you have SSL considerations, you'll probably get better client-side parallelization by calling the css files directly on the remote server from your own pages.

<ifModule mod_proxy.c>
    RewriteRule [P]

This will leverage mod_rewrite and mod_proxy to do exactly what you want, requests for pretty.css on your site will be fetched from the remote site and served as if it were yours.

Where you can get into trouble is when you start introducing regexes into the RewriteRule.

<ifModule mod_proxy.c>
    RewriteRule*)$1 [P]

This will pass anything like to the remote site, and the remote site will serve it up just fine.

share|improve this answer
I think he actually means rewrite the content within the requests? – Sargun Dhillon Dec 27 '10 at 21:18
@Sargun Even easier, just change the [P] to [R] and remove the ifModules, and that'll do exactly that. And safely! – sysadmin1138 Dec 27 '10 at 21:21
10x for the help, this is exactly what I was looking for. – bozhidarc Dec 29 '10 at 11:13

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.