How to redirect or mod_rewrite an Expired image in a directory using .htaccess?

php.net/manual/en/function.exif-read-dat... You can get the file date and then check that against the current time() say something like this: $img_head = exif_read_data($img_path, 'IFD0'); if ($img_head! = false) { if ($img_head'FILE. FileDateTime' Php"); exit; } } I really hope you get what I'm trying to say here as I'm typing from my phone.

php.net/manual/en/function.exif-read-dat... You can get the file date and then check that against the current time() say something like this: $img_head = exif_read_data($img_path, 'IFD0'); if ($img_head! = false) { if ($img_head'FILE. FileDateTime' Php"); exit; } } I really hope you get what I'm trying to say here as I'm typing from my phone...

Thanks Chris, I've already considered this solution before. The problem is now that I have an image in the /image/ folder that PHP has generated, I need apache to redirect back to the image_resize. Php if the requested image is old.

– He-Man Mar 31 at 5:41.

Well, I hope someone corrects me if I'm wrong, but the last I knew PHP is run as a module in Apache, via mod_php, so one way or another the web server is still having to churn through your code. Hmm. My original thought was to set the cache-control value using something like: Header set Cache-Control "max-age=14400, must-revalidate" but that won't work.

That would just tell Apache to grab a new copy of the image... EDIT: Yeah, @chris_mcclellan's idea is where I was headed in my thought process. I'd run with that and see if it meets your performance goals.

I have a redirect setup that looks for an image in a directory and if it does not exist, it will redirect to a php file that resizes an image and saves it to that directory. I got it to work great. Problem now is that I need to find a good way to redirect it if the image that was written is 4 hours old.

I looked into Mod_expires but could not find a way to redirect to my php image resizer when the image is 4 hours old. I know I could do this in PHP but the whole point was to reduce the server load by using apache instead of PHP. The site I'm working on gets several thousand viewers daily so I really need to efficiently cache the resized images.

If it does not exist, redirect to to "/image/resize_image. Now that I got that working how do I get it to redirect to "/image/resize_image. Php" when the "1234_01_thumb.

Jpg" gets x hours old?

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions