Jump to content
thirty bees forum
  • 0

Updating from 1.5.1 to Bleeding Edge Breaks Product Images


Question

Posted

I have been testing some bleeding edge updates and found that when I update a shop using bleeding edge, the product images are replaced by the camera icon on the product when displayed in the front of the shop because the images can't be found.  Rolling back to the stable version fixes this. The shop is running on PHP 8.0.30.  Shown below are the error log entries (multiple entries) displayed after the update.  Thumbnail generation does not find the images.  I've tried various setting changes on the Preferences, Image page with no luck.  Attached are screen shots of the original settings page and the new one.  Any ideas what needs to be done to fix this with the settings, or should I post a bug on github?

[28-Aug-2024 14:50:28 US/Eastern] PHP Warning:  Attempt to read property "images" on bool in /.../shop/classes/ImageEntity.php on line 118
[28-Aug-2024 14:50:28 US/Eastern] PHP Warning:  Attempt to read property "image" on null in /.../shop/classes/ImageEntity.php on line 118
[28-Aug-2024 14:50:28 US/Eastern] PHP Warning:  foreach() argument must be of type array|object, null given in /.../shop/classes/ImageEntity.php on line 118

old-image-page.png

new-image-page.png

Recommended Posts

  • 0
Posted

I am so embarrassed!  I had overrides created on a much older version of ThirtyBees across all three shops.  Once I updated the overrides using the newer core code, the problem was fixed.

My apologies for wasting your time.  Thanks for all the troubleshooting assistance!

  • Thanks 1
  • 0
Posted

I'm not sure how that is done.  Checking the database configuration I have:

MySQL version 10.6.18-MariaDB-cll-lve-log

....

MySQL engine InnoDB

MySQL driver PDO

  • 0
Posted

Duh!  Trying it now.  It shows a number of recommended changes in both the stable version and bleeding edge.  I'll do some playing here and report back later with the result.  Thanks!

  • 0
Posted

When you update to edge you are seeing the image rewrite that will be part of the next major version.

Steps to have no issues:

1. update to edge - both your files and database.

2. Go to Images and set your settings - preferred image format - better use webp as png does not have any improvement over webp. Select Image quality (this will be empty on your first update, if you now update again it will be populated BUT I'm not sure if this can be 0 (as the quality is from 1 to 100, 100 being ze best quality, 70 is recommended). Decide if you want to keep the original file in Source file extension. The rest is not important. Save.

3. On the top of this page you should see additional table column named Image Entities - each row should have entries as this assigns the usage of each generated file. This should be populated correctly if you updated just yesterday, as there was a bug bug this is now fixed in edge.

4. Reset indexation status on all image types (bottom of the page). Regenerate all images - wait for this to complete, don't leave the page.

5. Go to SEO & URLs and turn OFF friendly URLs, save, then turn it back ON (if you use friendly URLs as you should). This will regenerate the part of your htaccess file that serves the images as there is change too.

6. Clear your Cache and open your frontend - now if your theme is coded right you should see your images once again - smaller, optimized and better than ever before. If you don't see them check your theme and/or modules if they look for hardcoded jpg files. My theme did for some image types and the changes was pretty simple, just stick to a file format and swap the extension in the code. Keep in mind that this image rewrite handles pretty much every image on your shop (except the favicon) and whenever you have hardcoded .jpg you will have to fix this - theme, shop logo, custom menu module, custom layered navigation module, manufacturer logos, attribute textures, etc.

7. Additionally go to your Sitemap module (update it first to the last version). Select the proper image formats that should be included (this is new functionality) then save and regenerate your sitemap(s). (this is not directly related to your issue but should be done after the update to optimize your results as the sitemaps will include the new URLs for the images)

Get back to us if you managed to get it working and if not we will try to help again! 😉 

  • Like 1
  • 0
Posted
1 hour ago, the.rampage.rado said:

When you update to edge you are seeing the image rewrite that will be part of the next major version.

Steps to have no issues:
....


Get back to us if you managed to get it working and if not we will try to help again! 😉 

Thanks for the detailed explanation.  I have updated to bleeding and also the database.  In step 3 the image entries are displayed in the column.

When product images are being generated per step 4, multiple errors in pink boxes are generated similar to:

Source image for product x, image y not found (a/b/c.webp)

If you would like to debug further I could create an admin login for you.

I have reverted back to 1.5.1.

  • 0
Posted

Yes the source files are there and work for regeneration on 1.5.1.  When on bleeding edge it appears that the regeneration is selecting a source file based on the image format selected (e.g. if webp is selected looking for that as the source).  

  • 0
Posted

I have been playing trying to see how the images are mapped with information that may be helpful to figure out the behavior. Below is an example on a product image link obtained by right clicking and grabbing the image url.

Version 1.5.1

https://crew-mgr.com/shop/11-Crew_Manager_Community_Theme_Default_home/customize2x.webp

Bleeding Edge

https://crew-mgr.com/shop/products/11-Crew_Manager_Community_Theme_Default_home/customize2x.webp

Note the Bleeding Edge version inserts /products in the URL so maps the image location differently.

  • 0
Posted

Yes, the url is different now. Can you check if your active htaccess file contains (when on edge of course) contains lines as:

RewriteRule ^products/([0-9])(\-[_a-zA-Z0-9\s-]*)?/.+?([2-4]x)?\.(gif|jpeg|jpg|png|webp)$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3.$4 [L]
RewriteRule ^products/([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?/.+?([2-4]x)?\.(gif|jpeg|jpg|png|webp)$ %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4.$5 [L]
RewriteRule ^products/([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?/.+?([2-4]x)?\.(gif|jpeg|jpg|png|webp)$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5.$6 [L]
etc..

which are responsible for this rewrite.

  • 0
Posted
9 hours ago, the.rampage.rado said:

Yes, the url is different now. Can you check if your active htaccess file contains (when on edge of course) contains lines as:

RewriteRule ^products/([0-9])(\-[_a-zA-Z0-9\s-]*)?/.+?([2-4]x)?\.(gif|jpeg|jpg|png|webp)$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3.$4 [L]
RewriteRule ^products/([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?/.+?([2-4]x)?\.(gif|jpeg|jpg|png|webp)$ %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4.$5 [L]
RewriteRule ^products/([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?/.+?([2-4]x)?\.(gif|jpeg|jpg|png|webp)$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5.$6 [L]
etc..

which are responsible for this rewrite.

I believe you identified the problem.  The .htaccess file does not have the ^products/ modification when bleeding edge is installed. The lines are formatted similar to this that I copied.

RewriteRule ^([0-9])(\-[_a-zA-Z0-9\s-]*)?(-[0-9]+)?/.+?([2-4]x)?\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3$4.jpg [L]
  • 0
Posted

Follow up to the post above on .htaccess....

I have manually regenerated the .htacess file so the proper RewriteRules are in place. Same problem.  The product thumbnails generate fine with stable release, but the product images are not found when generating on bleeding edge.

Version 1.5.1:

RewriteRule ^([0-9])(\-[_a-zA-Z0-9\s-]*)?(-[0-9]+)?/.+?([2-4]x)?\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3$4.jpg [L]

Bleeding Edge: 

RewriteRule ^products/([0-9])(\-[_a-zA-Z0-9\s-]*)?/.+?([2-4]x)?\.(gif|jpeg|jpg|png|webp)$ %{ENV:REWRITEBASE}/$1/$1$2$3.$4 [L]
  • 0
Posted

@the.rampage.rado - if you let me know which files are used to generate the thumbnails on bleeding edge, I will do some investigating to see why the thumbnail source files are not found on my server for bleeding edge. Specifically - the file used to locate the original source image.  

  • 0
Posted
7 hours ago, theMerchantDev said:

Did you try to disable friendly URL?

If works, it's about server configuration, not TB.

no change with friendly URL disabled.

  • 0
Posted (edited)
3 hours ago, wakabayashi said:

https://crew-mgr.com/shop/ is your shop, right?

I really don't know, but these images are just loading normally for me!? 👻

Edit: or is this your live version and you have another version?

I rolled back to 1.5.1 after testing, so yes they are ok now but still broke on going to bleeding edge.

Edited by Rhapsody
  • 0
Posted
On 9/1/2024 at 3:08 PM, Rhapsody said:

@the.rampage.rado - if you let me know which files are used to generate the thumbnails on bleeding edge, I will do some investigating to see why the thumbnail source files are not found on my server for bleeding edge. Specifically - the file used to locate the original source image.  

Sorry for the late response. The original file is kept without additional attributes:
image.png.e2a2c5098928a57ee955d9697f028de9.png

Check which pic ID error out and download and check their files. There was before similar issue here after the image rewrite and in this case the source images were somehow corrupted on the server.

If this is not the case I'm afraid you will have to wait for datakick for advise. 😕

  • 0
Posted (edited)
24 minutes ago, the.rampage.rado said:

Sorry for the late response. The original file is kept without additional attributes:
image.png.e2a2c5098928a57ee955d9697f028de9.png

Check which pic ID error out and download and check their files. There was before similar issue here after the image rewrite and in this case the source images were somehow corrupted on the server.

If this is not the case I'm afraid you will have to wait for datakick for advise. 😕

Sorry for my confusing question.  I meant to ask which files in the Thirty Bees bleeding edge code are used to generate the images.  I can do some checking there to help localize the issue.  I do have all the original image files appearing in the directories with the generated images. It is only the product images the bleeding edge has problems with.  Images for categories are generated properly.

Edited by Rhapsody
added product images note
  • 0
Posted

classes/ImageManager.php look for function generateImageTypesByEntity

also you can check function getSourceImage. this function look for the file existence on the disk.

  • Like 1
  • 0
Posted (edited)
17 hours ago, Rhapsody said:

Sorry for my confusing question.  I meant to ask which files in the Thirty Bees bleeding edge code are used to generate the images.  I can do some checking there to help localize the issue.  I do have all the original image files appearing in the directories with the generated images. It is only the product images the bleeding edge has problems with.  Images for categories are generated properly.

Then I would bet, that your htaccess or nginx configuration is wrong. As the product images changed the url path. I made this to have a clean structure in urls. My nginx looks like this:

 

# Rewriting for images pretty url
location ~* \.(eot|gif|ico|jpg|jpeg|otf|pdf|png|svg|swf|ttf|woff|webp)$ {

	rewrite ^/categories/([0-9]+)/([^\s/]+)\.webp$ /img/c/$1.webp break;
	rewrite ^/categories/([0-9]+)-([^\s/]+)/([^\s/]+)\.webp$ /img/c/$1-$2.webp break;
	rewrite ^/categoriesthumb/([0-9]+)/([^\s/]+)\.webp$ /img/c/thumb/$1.webp break;
	rewrite ^/categoriesthumb/([0-9]+)-([^\s/]+)/([^\s/]+)\.webp$ /img/c/thumb/$1-$2.webp break;
	rewrite ^/manufacturers/([0-9]+)/([^\s/]+)\.webp$ /img/m/$1.webp break;
	rewrite ^/manufacturers/([0-9]+)-([^\s/]+)/([^\s/]+)\.webp$ /img/m/$1-$2.webp break;
	rewrite ^/scenes/([0-9]+)/([^\s/]+)\.webp$ /img/scenes/$1.webp break;
	rewrite ^/scenes/([0-9]+)-([^\s/]+)/([^\s/]+)\.webp$ /img/scenes/$1-$2.webp break;
	rewrite ^/scenesthumb/([0-9]+)/([^\s/]+)\.webp$ /img/scenes/thumbs/$1.webp break;
	rewrite ^/scenesthumb/([0-9]+)-([^\s/]+)/([^\s/]+)\.webp$ /img/scenes/thumbs/$1-$2.webp break;
	rewrite ^/stores/([0-9]+)/([^\s/]+)\.webp$ /img/st/$1.webp break;
	rewrite ^/stores/([0-9]+)-([^\s/]+)/([^\s/]+)\.webp$ /img/st/$1-$2.webp break;
	rewrite ^/suppliers/([0-9]+)/([^\s/]+)\.webp$ /img/su/$1.webp break;
	rewrite ^/suppliers/([0-9]+)-([^\s/]+)/([^\s/]+)\.webp$ /img/su/$1-$2.webp break;
	rewrite ^/products/([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.webp$ /img/p/$1/$1$2$3.webp break;
	rewrite ^/products/([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.webp$ /img/p/$1/$2/$1$2$3$4.webp break;
	rewrite ^/products/([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.webp$ /img/p/$1/$2/$3/$1$2$3$4$5.webp break;
	rewrite ^/products/([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.webp$ /img/p/$1/$2/$3/$4/$1$2$3$4$5$6.webp break;
	rewrite ^/products/([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.webp$ /img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.webp break;
	rewrite ^/products/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.webp$ /img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.webp break;
	rewrite ^/products/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.webp$ /img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.webp break;
	rewrite ^/products/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.webp$ /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.webp break;

	allow all;
	try_files  $uri  $uri/  /index.php?$args;
}

 

Edited by wakabayashi
  • 0
Posted
2 hours ago, wakabayashi said:

Then I would bet, that your htaccess or nginx configuration is wrong. As the product images changed the url path. I made this to have a clean structure in urls. My nginx looks like this:

......

 

I'm on a shared hosting account on Apache.  This is one of two shops I've tried bleeding edge on that breaks the product images.  before and after update to bleeding edge pasted below.

.htaccess excerpt TB version 1.5.1

# Domain: chnyc.us
RewriteRule . - [E=REWRITEBASE:/shop/]

# Webservice API
RewriteRule ^api$ api/ [L]
RewriteRule ^api/(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]

# Images
RewriteCond %{HTTP_HOST} ^chnyc.us$
RewriteRule ^([0-9])(\-[_a-zA-Z0-9\s-]*)?(-[0-9]+)?/.+?([2-4]x)?\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3$4.jpg [L]
RewriteCond %{HTTP_HOST} ^chnyc.us$
RewriteRule ^([0-9])(\-[_a-zA-Z0-9\s-]*)?(-[0-9]+)?/.+?([2-4]x)?\.webp$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3$4.webp [L]
RewriteCond %{HTTP_HOST} ^chnyc.us$
RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?(-[0-9]+)?/.+?([2-4]x)?\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4$5.jpg [L]
RewriteCond %{HTTP_HOST} ^chnyc.us$
RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?(-[0-9]+)?/.+?([2-4]x)?\.webp$ %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4$5.webp [L]
RewriteCond %{HTTP_HOST} ^chnyc.us$
RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?(-[0-9]+)?/.+?([2-4]x)?\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5$6.jpg [L]
RewriteCond %{HTTP_HOST} ^chnyc.us$
RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?(-[0-9]+)?/.+?([2-4]x)?\.webp$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5$6.webp [L]
RewriteCond %{HTTP_HOST} ^chnyc.us$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?(-[0-9]+)?/.+?([2-4]x)?\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6$7.jpg [L]
RewriteCond %{HTTP_HOST} ^chnyc.us$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?(-[0-9]+)?/.+?([2-4]x)?\.webp$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6$7.webp [L]
RewriteCond %{HTTP_HOST} ^chnyc.us$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?(-[0-9]+)?/.+?([2-4]x)?\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7$8.jpg [L]
RewriteCond %{HTTP_HOST} ^chnyc.us$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?(-[0-9]+)?/.+?([2-4]x)?\.webp$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7$8.webp [L]
RewriteCond %{HTTP_HOST} ^chnyc.us$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?(-[0-9]+)?/.+?([2-4]x)?\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8$9.jpg [L]
RewriteCond %{HTTP_HOST} ^chnyc.us$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?(-[0-9]+)?/.+?([2-4]x)?\.webp$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8$9.webp [L]
RewriteCond %{HTTP_HOST} ^chnyc.us$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?(-[0-9]+)?/.+?([2-4]x)?\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9$10.jpg [L]
RewriteCond %{HTTP_HOST} ^chnyc.us$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?(-[0-9]+)?/.+?([2-4]x)?\.webp$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9$10.webp [L]
RewriteCond %{HTTP_HOST} ^chnyc.us$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?(-[0-9]+)?/.+?([2-4]x)?\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10$11.jpg [L]
RewriteCond %{HTTP_HOST} ^chnyc.us$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?(-[0-9]+)?/.+?([2-4]x)?\.webp$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10$11.webp [L]
RewriteCond %{HTTP_HOST} ^chnyc.us$
RewriteRule ^c/([0-9]+)(\-[\.*_a-zA-Z0-9\s-]*)(-[0-9]+)?/.+?([2-4]x)?\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2$3$4.jpg [L]
RewriteCond %{HTTP_HOST} ^chnyc.us$
RewriteRule ^c/([0-9]+)(\-[\.*_a-zA-Z0-9\s-]*)(-[0-9]+)?/.+?([2-4]x)?\.webp$ %{ENV:REWRITEBASE}img/c/$1$2$3$4.webp [L]
RewriteCond %{HTTP_HOST} ^chnyc.us$
RewriteRule ^c/([a-zA-Z\s_-]+)(-[0-9]+)?/.+?([2-4]x)?\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2$3.jpg [L]
RewriteCond %{HTTP_HOST} ^chnyc.us$
RewriteRule ^c/([a-zA-Z\s_-]+)(-[0-9]+)?/.+?([2-4]x)?\.webp$ %{ENV:REWRITEBASE}img/c/$1$2$3.webp [L]

.htaccess excerpt TB Bleeding Edge

# Domain: chnyc.us
RewriteRule . - [E=REWRITEBASE:/shop/]

# Webservice API
RewriteRule ^api$ api/ [L]
RewriteRule ^api/(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]

# Images

# categories images
RewriteCond %{HTTP_HOST} ^chnyc.us$
RewriteRule ^categories/([0-9]+)(\-[_a-zA-Z0-9\s-]*)?/.+?([2-4]x)?\.(gif|jpeg|jpg|png|webp)$ %{ENV:REWRITEBASE}img/c/$1$2$3.$4 [L]

# categoriesthumb images
RewriteCond %{HTTP_HOST} ^chnyc.us$
RewriteRule ^categoriesthumb/([0-9]+)(\-[_a-zA-Z0-9\s-]*)?/.+?([2-4]x)?\.(gif|jpeg|jpg|png|webp)$ %{ENV:REWRITEBASE}img/c/thumb/$1$2$3.$4 [L]

# manufacturers images
RewriteCond %{HTTP_HOST} ^chnyc.us$
RewriteRule ^manufacturers/([0-9]+)(\-[_a-zA-Z0-9\s-]*)?/.+?([2-4]x)?\.(gif|jpeg|jpg|png|webp)$ %{ENV:REWRITEBASE}img/m/$1$2$3.$4 [L]

# products images
RewriteCond %{HTTP_HOST} ^chnyc.us$
RewriteRule ^products/([0-9])(\-[_a-zA-Z0-9\s-]*)?/.+?([2-4]x)?\.(gif|jpeg|jpg|png|webp)$ %{ENV:REWRITEBASE}/$1/$1$2$3.$4 [L]
RewriteCond %{HTTP_HOST} ^chnyc.us$
RewriteRule ^products/([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?/.+?([2-4]x)?\.(gif|jpeg|jpg|png|webp)$ %{ENV:REWRITEBASE}/$1/$2/$1$2$3$4.$5 [L]
RewriteCond %{HTTP_HOST} ^chnyc.us$
RewriteRule ^products/([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?/.+?([2-4]x)?\.(gif|jpeg|jpg|png|webp)$ %{ENV:REWRITEBASE}/$1/$2/$3/$1$2$3$4$5.$6 [L]
RewriteCond %{HTTP_HOST} ^chnyc.us$
RewriteRule ^products/([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?/.+?([2-4]x)?\.(gif|jpeg|jpg|png|webp)$ %{ENV:REWRITEBASE}/$1/$2/$3/$4/$1$2$3$4$5$6.$7 [L]
RewriteCond %{HTTP_HOST} ^chnyc.us$
RewriteRule ^products/([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?/.+?([2-4]x)?\.(gif|jpeg|jpg|png|webp)$ %{ENV:REWRITEBASE}/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.$8 [L]
RewriteCond %{HTTP_HOST} ^chnyc.us$
RewriteRule ^products/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?/.+?([2-4]x)?\.(gif|jpeg|jpg|png|webp)$ %{ENV:REWRITEBASE}/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.$9 [L]
RewriteCond %{HTTP_HOST} ^chnyc.us$
RewriteRule ^products/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?/.+?([2-4]x)?\.(gif|jpeg|jpg|png|webp)$ %{ENV:REWRITEBASE}/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.$10 [L]
RewriteCond %{HTTP_HOST} ^chnyc.us$
RewriteRule ^products/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9\s-]*)?/.+?([2-4]x)?\.(gif|jpeg|jpg|png|webp)$ %{ENV:REWRITEBASE}/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.$11 [L]

# scenes images
RewriteCond %{HTTP_HOST} ^chnyc.us$
RewriteRule ^scenes/([0-9]+)(\-[_a-zA-Z0-9\s-]*)?/.+?([2-4]x)?\.(gif|jpeg|jpg|png|webp)$ %{ENV:REWRITEBASE}img/scenes/$1$2$3.$4 [L]

# scenesthumb images
RewriteCond %{HTTP_HOST} ^chnyc.us$
RewriteRule ^scenesthumb/([0-9]+)(\-[_a-zA-Z0-9\s-]*)?/.+?([2-4]x)?\.(gif|jpeg|jpg|png|webp)$ %{ENV:REWRITEBASE}img/scenes/thumbs/$1$2$3.$4 [L]

# stores images
RewriteCond %{HTTP_HOST} ^chnyc.us$
RewriteRule ^stores/([0-9]+)(\-[_a-zA-Z0-9\s-]*)?/.+?([2-4]x)?\.(gif|jpeg|jpg|png|webp)$ %{ENV:REWRITEBASE}img/st/$1$2$3.$4 [L]

# suppliers images
RewriteCond %{HTTP_HOST} ^chnyc.us$
RewriteRule ^suppliers/([0-9]+)(\-[_a-zA-Z0-9\s-]*)?/.+?([2-4]x)?\.(gif|jpeg|jpg|png|webp)$ %{ENV:REWRITEBASE}img/su/$1$2$3.$4 [L]

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...