httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Macks2 <aaron.ma...@harvardbusiness.org>
Subject Re: [users@httpd] RewriteRule overbinding in 2.2
Date Tue, 30 Apr 2019 17:30:39 GMT
Apparently I needed to just tell it to the bear.  In looking to verify rewritelog configs I
found that the rewrite I was changing was not the one being hit, wrong vHost

A
------------------------------------------------
Aaron Macks
Systems Architect


On Apr 30, 2019, at 11:14 AM, Eric Covener <covener@gmail.com<mailto:covener@gmail.com>>
wrote:

On Tue, Apr 30, 2019 at 11:05 AM Aaron Macks2
<aaron.macks@harvardbusiness.org<mailto:aaron.macks@harvardbusiness.org>> wrote:

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/logo-image.pl?image=$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.,

https://site.url/images-sold/foo-bar-498-24340-1.jpg

works, calling /cgi-bin/logo-image.pl?image=24340-1.jpg, but

https://site.url/images-sold/foo-bar-49899-24340-1.jpg

calls /cgi-bin/logo-image.pl?image=49899-24340-1.jpg.

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

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

I verified the regex as valid PCRE and tested as best I can with the htaccess tester here
https://htaccess.madewithlove.be/

but cannot seem to figure it out

Doesn't really seem possible, have you looked at the RewriteLog?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org<mailto:users-unsubscribe@httpd.apache.org>
For additional commands, e-mail: users-help@httpd.apache.org<mailto:users-help@httpd.apache.org>


Mime
View raw message