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 am developing a mirror website (where people can download files, sort of like a FTP). I was wondering about using CloudFlare to help cut down on bandwidth usage. I have the mirror website with mod_rewrite, so that when a user goes to it is redirected to which increments the number of downloads and outputs "". Here is the rewrite rule:

RewriteRule ^(.*)/((.*)(.zip))$ /download.php?path=$1&file=$2

I was wondering if I use CloudFlare on this website, will it pretty much render the .htaccess file useless and PHP code useless?

share|improve this question
up vote 3 down vote accepted

Based on this page, Cloudflare don't cache zip files. If the zip files are most of your bandwidth, CloudFlare won't save you much.

The RewriteRule you supplied above does not do a redirect. For a redirect, you would need something like [R] or [R=301] after the rule.

If you find a competing service that does cache zip files for you, the redirect might be the right way to achieve both your goals. Send the downloader a link to as you are currently doing (leave in the rewrite that has a PHP file serve this page) but have the PHP send back a redirect (HTTP 302 or 303 response code) sending them to Their client will then make a new request for that URL and will actually get the file.

share|improve this answer

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.