Jump to content

Product image not load properly after adding Media Server


Recommended Posts

So i recently tried to use a media server to off load the HTTP request.

 

my media server is http//s3.example.com

 

I uploaded the following folders and its content:

  • img
  • themes

Everything looks okay, my site still works properly except for one thing:

 

I'm getting missing picture for all of my product image.

 

I have tried the following:

  • Turned off friendly URL --> then everything works like a charm. Product image can be displayed (but only when friendly URL is turned off.
  • Regenerate thumbnails --> Still get missing image.
  • Move image --> Still get missing image.

Full url with "Friendly URL" turned on is:

http://xx.bro.do/2579-product_list_default/langdon-parka-black.jpg

With "Friendly URL" turned off, it becomes:

http://xx.bro.do/img/p/2/5/7/9/2579-product_list_default.jpg

So, somehow the "Friendly URL' is not being redirected properly to the "Unfriendly URL"

 

Below is a snippets of my .htaccess

 

# Images
RewriteCond %{HTTP_HOST} ^xx.bro.do$ [OR]
RewriteCond %{HTTP_HOST} ^brodo.dev$
RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3.jpg [L]
RewriteCond %{HTTP_HOST} ^xx.bro.do$ [OR]
RewriteCond %{HTTP_HOST} ^brodo.dev$
RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4.jpg [L]
RewriteCond %{HTTP_HOST} ^xx.bro.do$ [OR]
RewriteCond %{HTTP_HOST} ^brodo.dev$
RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5.jpg [L]
RewriteCond %{HTTP_HOST} ^xx.bro.do$ [OR]
RewriteCond %{HTTP_HOST} ^brodo.dev$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg [L]
RewriteCond %{HTTP_HOST} ^xx.bro.do$ [OR]
RewriteCond %{HTTP_HOST} ^brodo.dev$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg [L]
RewriteCond %{HTTP_HOST} ^xx.bro.do$ [OR]
RewriteCond %{HTTP_HOST} ^brodo.dev$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg [L]
RewriteCond %{HTTP_HOST} ^xx.bro.do$ [OR]
RewriteCond %{HTTP_HOST} ^brodo.dev$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg [L]
RewriteCond %{HTTP_HOST} ^xx.bro.do$ [OR]
RewriteCond %{HTTP_HOST} ^brodo.dev$
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg [L]

Can anyone help me with this? Why the product image is not loaded properly using friendly URL

Edited by sibrodo (see edit history)
  • Like 1
Link to comment
Share on other sites

Do the images actually exists on your application server? In order to use the "Media Server" feature of PrestaShop it seems you have to use a real CDN like AWS CloudFront. Then you'll set your application server as the origin for your CDN distribution.

Link to comment
Share on other sites

×
×
  • Create New...