Jump to content

[SOLVED] Mod rewrite help, please


Recommended Posts

I have over 1 million downloadable products in my online store but I don't want to have individual images because there would be over 3 million images in this directory.

The product image NAMES are generated in PS like this:
XXXXX-YYYYY-home.jpg
XXXXX-YYYYY-medium.jpg
XXXXX-YYYYY-large.jpg

Where XXXXX = the productID and YYYYY = the id of the image record in the image table.

Since I want them to use the exact same image(s) because they are downloadable products, how can I create a mod-rewrite entry where any product image name generated by the store would actually return these?
1-1-home.jpg
1-1-medium.jpg
1-1-large.jpg

Link to comment
Share on other sites

For what it's worth, I think this will work, haven't had time to try it, yet:

RewriteRule ^(.*)/([0-9]+)-([0-9]+)-home.jpg$ /img/p/1-1-home.jpg [PT]
RewriteRule ^(.*)/([0-9]+)-([0-9]+)-medium.jpg$ /img/p/1-1-medium.jpg [PT]
RewriteRule ^(.*)/([0-9]+)-([0-9]+)-large.jpg$ /img/p/1-1-large.jpg [PT] 

Link to comment
Share on other sites

×
×
  • Create New...