Jump to content

Images not showing (wrong images path with language iso code).


Recommended Posts

Hello,

I am running the last version of prestashop (1.6.0.14) and some images are not showing, The bug appears on cms pages and only when friendly url is enabled.

An other user had the same issue, and had updated his prestashop and the bug disappear, but i am running the last version and the bug is sill here.

Post from Acido : https://www.prestashop.com/forums/topic/317154-images-not-showing/

Unfortunately this fix doesn't work to me. All the image that i upload to the cms page, are pointed to www.domain.com/en/img/cms/image.jpg

By change the language, the url change pointing to the new language, example: www.domain.com/en/img/cms/image.jpg

That it's what ruin the image url which is www.domain.com/img/cms/image.jpg

The image path include the language iso code like (en or de), its why it fails to load images. 

 

Any help is welcome! 

Thanks in advance.

 

xlynx

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

  • 2 weeks later...

Same problem here...

The shop was created and developed using only one language, so the path doesn't have iso code in it: domain.com/img/cms/image.jpg

 

now decided to add another language and whole shop is now under domain.com/en/ and domain.com/de/ so, and all images in CMS disappeared because of this language iso code in the path.

 

How to solve this? Please help. 

Link to comment
Share on other sites

Hey,

 

To remove the language iso code from the url, you can add in your .htacess this line :

RewriteRule ^(.*)/img/cms/(.*)$ /img/cms/ [L,R=301]

It works for me with the default cms folder.

 

An other thing .... When I check the code source of the CMSs, I find that URLs have domain name written, and its bad if we are working on local environment and we want to export it after in a production environment.

To avoid this, when we add an image in TinyMce "insert-edit image", we can change the source of the image by removing the domain name and let only "/img/cms/image.jpg".

 

Best

xlynx

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

  • 2 years later...
×
×
  • Create New...