#$contents is content of entire file we are asked for, not a part of it! $r->set_content_length(length($contents)); if((my $status = $r->meets_conditions) eq OK()) { $r->send_http_header if ($mod_perl::VERSION < 1.99); } else { return $status; } return OK() if $r->header_only; my $range_request = ($mod_perl::VERSION < 1.99) ? $r->set_byterange : 0; if($range_request) { while(my($offset, $length) = $r->each_byterange) { $r->print(substr($contents, $offset, $length)); } } #I've also tried adding "return 206;" here. Apache still returns status code 200 else { $r->print($contents); } return OK();