mod rewrite: point the existing image path to the new one?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
lauthiamkok
Forum Contributor
Posts: 153
Joined: Wed Apr 01, 2009 2:23 pm
Location: Plymouth, United Kingdom

mod rewrite: point the existing image path to the new one?

Post by lauthiamkok »

Hi,
I have sent my e-newsletters to my contact list sometime ago, with the image source/path something like below,

<img src="http://mysite.com/img-layout/1.jpg" border="0" />
<img src="http://mysite.com/img-layout/2.jpg" border="0" />
<img src="http://mysite.com/img-layout/3.jpg" border="0" />
<img src="http://mysite.com/img-layout/4.jpg" border="0" />

But I have changed the path of the folder where I keep the images to this,

views/www/uploads/images/

so now the image path should be like this,

<img src="http://mysite.com/views/www/uploads/images/1.jpg" border="0" />

But the newsletter had been sent so I cannot change the newsletter's content in the recipient side.

So, I wonder if I can use mod-rewrite to point the old image path to the new one when the recipient open and read the newsletter again?

I have tried doing something like this below but it doesn't work!

Code: Select all

RewriteRule ^img-layout/(.+)\.(jpg|gif)$  /views/www/uploads/images/large/$1.$2 [L]
It would be great if you have any ideas.

Many thanks,
Lau
Post Reply