我有一個問題,我們有圖像加載從各種html源和直接圖像請求和「文件不存在」正在發生。不幸的是,這是由於在這個應用程序的緩存清理過程中已經調整大小/緩存的許多圖像,因此必須重新生成。直接http請求較小的圖像只是返回一個錯誤,因爲除了文件不存在之外,Apache沒有任何區別。如何觸發[php]用Apache發現錯誤圖像的腳本?
我想寫一個腳本,如果出現錯誤,將重新生成這些圖像。換句話說,一個錯誤被觸發,然後調用一個腳本,以便在原始圖像被請求時重新生成有問題的圖像,然後該緩存的圖像將被提供。如何使用httpd設置它?
這是錯誤日誌的一個片段:
[Mon Apr 15 13:51:36 2013] [error] [client xxx.xxx.xxx.xxx] File does not exist: /home/username/public_html/domain.tld/media/catalog/product/cache/1/small_image/180x180/4da38bab36523d0886e53b8d57126395/h/k/hk0412.jpg
[Mon Apr 15 13:57:24 2013] [error] [client xxx.xxx.xxx.xxx] File does not exist: /home/username/public_html/domain.tld/media/catalog/product/cache/1/image/4da38bab36523d0886e53b8d57126395/n/c/nca20212.jpg
[Mon Apr 15 13:57:47 2013] [error] [client xxx.xxx.xxx.xxx] File does not exist: /home/username/public_html/domain.tld/media/catalog/product/cache/1/image/4da38bab36523d0886e53b8d57126395/v/z/vz0612.jpg
[Mon Apr 15 13:58:42 2013] [error] [client xxx.xxx.xxx.xxx] File does not exist: /home/username/public_html/domain.tld/media/catalog/product/cache/1/small_image/220x220/4da38bab36523d0886e53b8d57126395/R/A/RA01112.jpg
你可以設置所有的jpg \ gif請求去一個PHP腳本,如果存在或創建將提供文件。不知道它是否是最好的想法 – 2013-04-15 20:13:37