0

Can any one tell me why this works:

r301 %r{(?:images\/)(\d*.jpe?g|png|gif)$}, 'http://mybucket.s3.amazonaws.com/540x310/$1'

URI = http://www.mysite.com/images/42720.jpeg

and this doesn't

r301 %r{(?:resized_images\/\d*x\d*\/)(\d*.jpe?g|png|gif)$}, 'http://mybucket.s3.amazonaws.com/540x310/$1'

URI = http://www.mysite.com/resized_images/560x344/77664.jpeg

Both work at Rubular:

http://rubular.com/r/PXHiEcoEqy
http://rubular.com/r/BfOta6YJa7

thanks in advance

----------update-------------

This is an issue with how i'm using rack-rewrite:

The rewrite isn't working with two 301 query strings.

if i comment out the first line the second works and vice versa.

Any idea how to get them both working.

use Rack::Rewrite do
    r301 %r{(?:images\/)(\d*.jpe?g|png|gif|bmp)$}, 'http://mybucket.s3.amazonaws.com/540x310/$1'
    r301 %r{(?:resized_images\/\d*x\d*\/)(\d*.jpe?g|png|gif|bmp)$}, 'http://mybucket.s3.amazonaws.com/540x310/$1'
 end
dp6ai
  • 41
  • 3
  • Has anyone got any idea on this. is there an issue in the regex that im not picking up in rubular? – dp6ai Jan 28 '14 at 11:40

1 Answers1

0

final answer.

I broke the second redirect out into another use Rack::rewrite and it fixed the issue

dp6ai
  • 41
  • 3