| 
 
 
 | 
| Keep Server Online 
 If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
 
 or
 
 
   
 A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
 
 Thank You! Steffen
 
 Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
 |  | 
 | 
| | 
| | 
|  Topic: Mod rewrite help, please |  |  
| Author |  |  
| MB34 
 
 
 Joined: 09 Aug 2010
 Posts: 2
 
 
 | 
|  Posted: Mon 09 Aug '10 19:03    Post subject: Mod rewrite help, please |   |  
| 
 |  
| 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 would normally formatted like this (this is how they are generated in my store software):
 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 retdirect to  these images?
 1-1-home.jpg
 1-1-medium.jpg
 1-1-large.jpg
 
 The also will all be in directory /img/p
 |  |  
| Back to top |  |  
| cyclone 
 
 
 Joined: 12 Sep 2006
 Posts: 16
 Location: St Louis
 
 | 
|  Posted: Tue 10 Aug '10 7:00    Post subject: |   |  
| 
 |  
| I am not regex pro but try: 
 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]
 
 Perhaps more generically:
 
 RewriteRule  ^(.*)/([0-9]+)-([0-9]+)-([a-z]+).jpg$   /img/p/1-1-$3.jpg  [PT]
 |  |  
| Back to top |  |  
| MB34 
 
 
 Joined: 09 Aug 2010
 Posts: 2
 
 
 | 
|  Posted: Tue 10 Aug '10 17:17    Post subject: |   |  
| 
 |  
| Will give it a try. |  |  
| Back to top |  |  
 
 | 
 |  | 
 |  |