Closed dp6ai closed 10 years ago
Has anyone seen anything like this before? The two redirects seem to be very similar, i cant understand why one is working but not the other?
thanks
Ok I have got a little further.
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
Obviously i needed to change $1 to $2 in the second line.
thanks and closing.
Sorry. End of the day and that isnt working can anyone point me in the right direction. thanks
final answer. I hope
I broke the second redirect out into another use Rack::rewrite and it fixed the issue
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\/\dx\d\/)(\d*.jpe?g|png|gif)$}, 'http://mybucket.s3.amazonaws.com/540x310/$1'
URI = http://mysite.com/resized_images/560x344/77664.jpeg
Both work at Rubular: http://rubular.com/r/PXHiEcoEqy http://rubular.com/r/BfOta6YJa7