I use php on a couple sites to vary an image according to day of the week, day of the year etc. I'm wondering if there would be a way to do the same thing when someone hotlinks to an image hosted on my server. The image would be updated then as the date changed. Maybe using htaccess?
Great idea, I think it could be done, however im not too sure how to implement it. I dont think htaccess would really be required.
I'm sure it could be done with javascript, but I'd rather have people use a simple image link that displays that days image. I suppose i could change the image file every day... I don't htaccess very well. Can an image request be redirected? Could that be dependent on date?
I'm finding clues that it can be done...just don't know how to pull it together. RewriteCond %{TIME_DAY} ^([0-9]{1,2})$ RewriteCond %{TIME_MONTH} ^([0-9]{1,2})$ RewriteCond %{TIME_YEAR} ^([0-9]{4})$ RewriteRule ^/?$1-%2-%3/(.*)$ image.gif?$1 Code (markup): that didn't work
Got it! RewriteRule ^pic.gif$ pic-%{TIME_MON}-%{TIME_DAY}.gif then create files named by date like pic-03-08.gif pic-03-09.gif pic-03-10.gif at least it works on my site. I don't see why it won't work with hot linking as well.