httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Cramer <>
Subject mod_rewrite RewriteCond filesize comparison
Date Mon, 12 Nov 2007 16:16:51 GMT
I've created an enhancement bug in bugzilla with an attached patch to 
support specific size comparisons in RewriteCond directives. Here's the 

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.

Mike Cramer | AIM/Flickr/ MikeWebkist

View raw message