You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Michael Cramer <cr...@webkist.com> on 2007/11/12 17:16:51 UTC

mod_rewrite RewriteCond filesize comparison

I've created an enhancement bug in bugzilla with an attached patch to 
support specific size comparisons in RewriteCond directives. Here's the 
description:

mod_rewrite supports a "-s" CondPattern which checks if the specified TestString
is a regular file with non-zero size. The attached patch expands the "-s" option
to support comparisons against arbitrary sizes.

Matches files greater than 100000 bytes:
RewriteCond TestString -s>100000

Matches files less than 4023 bytes:
RewriteCond TestString -s<4023

Matches files exactly 230000 bytes:
RewriteCond TestString -s=230000

The old specification still works as well:

RewriteCond TestString -s

is equivalent to :

RewriteCond TestString -s>0


The patch is attached to the bug and was created against 2.2.6.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43845

-- 
Mike Cramer
http://www.webkist.com/ | AIM/Flickr/Last.fm: MikeWebkist