httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Macks2 <>
Subject [users@httpd] RewriteRule overbinding in 2.2
Date Tue, 30 Apr 2019 15:04:54 GMT
I have a problem with a RewriteRule where it appears to be over-binding in the REGEX:

RewriteRule ([0-9]{4,6}(?:-[0-9]{1,2})?\.jpg)$     /cgi-bin/$1 [L,PT]

What it should do is bind a 4-6 digit number, followed by an optional - and a 1-2 digit number,
and finally .jpg, at the end of the URL, and send them as a query string to the backend. It
works fine unless there is another 4-6 digit number in the URL, e.g.,


works, calling /cgi-bin/, but


calls /cgi-bin/

I've tried as 2 seperate regexes, and gotten the same response

RewriteRule ([0-9]{4,6})(-[0-9]{1,2})?\.jpg$     /cgi-bin/$1$2.jpg [L,PT]

I verified the regex as valid PCRE and tested as best I can with the htaccess tester here

but cannot seem to figure it out

apache version: 2.2.15-69
OS: Centos 6.10
Aaron Macks
Systems Architect

View raw message