cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Media prettyURL - images not rendered

0 Kudos
937

Hi experts,

I'm trying to fix an issue with SEO URLs.

We are trying to make all the media URLs SEO friendly, hence we set the property

media.legacy.prettyURL  = true

All the images are stored with the following path:

/medias/sys_master/images/images/h4e/h75/8807025868830.jpg

With the property set to true and using the OTB mediaUrlStrategy the URLs become:

/medias/sys_master/images/images/h4e/h75/8807025868830/image_realfilename.jpg

However, images in storefront are not rendered and if I inspect the console in my browser, I can see 404 HTTP responses for all the images.

Can you please tell me if I missed something? I tried to do the same steps by using the OTB Hybris Vanilla and everything works fine in both Apparel and Electronics.

When I set the property, I stopped the server, did an ant clean all and restart the server.

P.s: I've just noticed that if I put root as media folder for an image, the image is rendered correctly, but if I move the media in images folder, the storefront is not able to find it.

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

The issue for us was caused by a wrong Tomcat configuration in tomcat_context.tpl file.

Answers (2)

Answers (2)

0 Kudos

Hi Stefan,

thanks for the answer!

I followed your suggestion, however, it didn't work. First I moved all the images from images folder to root folder and triggered the sync. I reloaded the homepage and I was able to see the images. When I moved the images back from root to images a triggered again the sync, I wasn't able to see them in the storefront.

The strangest thing is that if I set to false the property media.legacy.prettyURL, the generated Urls contain the realfilename + the context and I can see all the images (both from root and images folder). I'm also able to see the local folder when I inspect the sources in Chrome (see the following 2 screenshots)

But when I set the property to true, the Urls contains the realfilename with no context and I'm able to see only the images belonging to the root folder. In addiction to that, the local folder is not "generated" in the sources section of Chrome (see the other 2 screenshot).

I tried also to initialize the system on my local, but it didn't work.

Any idea?

Thanks.

StefanKruk
Active Participant
0 Kudos

We faced a similar issue after upgrading to 1905. The problem was that the URL is rendered differently than before.

As you have written, now the URL contains the Media Folder. Those of the above-mentioned URL is created.

Unfortunately, we discovered that not all Images are physical in the correct folder. Therefore we needed to move them to root and back to the correct folder so that SAP Commerce is transferring them to the correct folder.

If you exchange "image" with "root" it is most likely the same case. Please Test it via Backoffice (beside the MediaFolder field in Backoffice is a button to move the Medias which needs to be triggered)