Jump to content

[SOLVED] wrong image path on category and sub-cat with url rewriting


SHIROKO

Recommended Posts

Hi,

 

When I turn on rewrite URLs the category image and sub-category images are not displayed.

This is because PrestaShop asks for a wrong URL as you can see :

 

the /img/ folder is deleted and the .jpg extension is added to the category name

 

Failed to load resource: the server responded with a status of 404 (Not Found)

http://www.globaltech.pro/c/3-tm_home_default/activities.jpg

 

actually it should be :

 

http://www.globaltech.pro/img/c/3-tm_home_default.jpg

 

I'm running prestashop 1.6.0.9 today's fresh install.

Server nginx 1.6.0

Edited by SHIROKO (see edit history)
Link to comment
Share on other sites

ok, I'll answer my own question :

 

In my rewrite rules I was missing the right syntaxe :

rewrite ^/c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ /img/c/$1$2$3.jpg last;

 

Now the images are displayed andeverything works ok

  • Like 1
Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...
×
×
  • Create New...