logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

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.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Mod rewrite help, please
Author
MB34



Joined: 09 Aug 2010
Posts: 2

PostPosted: Mon 09 Aug '10 19:03    Post subject: Mod rewrite help, please Reply with quote

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

PostPosted: Tue 10 Aug '10 7:00    Post subject: Reply with quote

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

PostPosted: Tue 10 Aug '10 17:17    Post subject: Reply with quote

Will give it a try.
Back to top


Reply to topic   Topic: Mod rewrite help, please View previous topic :: View next topic
Post new topic   Forum Index -> Apache