Skip to main content
Tweeted twitter.com/#!/StackMagento/status/323978205012819969
added example of how i plan to call script
Source Link
ylluminate
  • 255
  • 1
  • 5
  • 10

Missing files in /media/ - help on how to write a script that will regenerate based on .htaccess call?

Moving further along in this, I can see that I need to be able to execute a Magento script upon failure of finding an image (particularly since many of these images are not being found due to being called by external references such as emails or other sites). I expect to use something like this from Apache to call this script that I'm hoping to get help on here:

# Inside of .htaccess:
######################
# if the file exists, just send it
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^cache/.*$ - [L]

# if it doesn't exists, rewrite to PHP script
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^cache/.*$ /path/to/script.php?url=$0 [L]

Missing files in /media/ - how to regenerate?

Missing files in /media/ - help on how to write a script that will regenerate based on .htaccess call?

Moving further along in this, I can see that I need to be able to execute a Magento script upon failure of finding an image (particularly since many of these images are not being found due to being called by external references such as emails or other sites). I expect to use something like this from Apache to call this script that I'm hoping to get help on here:

# Inside of .htaccess:
######################
# if the file exists, just send it
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^cache/.*$ - [L]

# if it doesn't exists, rewrite to PHP script
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^cache/.*$ /path/to/script.php?url=$0 [L]
correction
Source Link
ylluminate
  • 255
  • 1
  • 5
  • 10

I performed a complete cache clean and discovered that this obliterates everything under /media/ (as noted by me below and later correctly observed by an answer, it is indeed just the cache that is being wiped under the /media/ folder). Unfortunately there are some email distributions from the past that rely on these images and I am curious as to whether there is a way to regenerate all of the thumbnails / cache entries under the /media/ folder?

I performed a complete cache clean and discovered that this obliterates everything under /media/. Unfortunately there are some email distributions from the past that rely on these images and I am curious as to whether there is a way to regenerate all of the thumbnails / cache entries under the /media/ folder?

I performed a complete cache clean and discovered that this obliterates everything under /media/ (as noted by me below and later correctly observed by an answer, it is indeed just the cache that is being wiped under the /media/ folder). Unfortunately there are some email distributions from the past that rely on these images and I am curious as to whether there is a way to regenerate all of the thumbnails / cache entries under the /media/ folder?

one more folder addition
Source Link
ylluminate
  • 255
  • 1
  • 5
  • 10

When I do look for the images, for example, I do see the originals present in: media/catalog/product/F/U/

The goal, therefore, is to regenerate all of these appropriately.

The goal, therefore, is to regenerate all of these appropriately.

When I do look for the images, for example, I do see the originals present in: media/catalog/product/F/U/

The goal, therefore, is to regenerate all of these appropriately.

more detail
Source Link
ylluminate
  • 255
  • 1
  • 5
  • 10
Loading
Source Link
ylluminate
  • 255
  • 1
  • 5
  • 10
Loading