0

I have two projects:

  • relaunch.company.de
  • redesign.company.de (clone from relaunch.company.de)

Note: The base url of both projects is set to their pub directory.

I want to setup redesign.company.de to make it load images from relaunch.company.de so that I don't always have to upload the media to both projects.

So In redesign.company.de I added the URL https://relaunch.company.de/media/ to

Stores -> Settings: Configuration -> General -> Base Url's -> Base URL for User Media Files

and to

Stores -> Settings: Configuration -> General -> Base Url's (Secure) -> Base URL for User Media Files

Then I flushed the cache.

But there are almost no images loaded in redesign.company.de

So I compared the same product on both servers and inspected the image urls.

On relaunch.company.de I get:

https://relaunch.company.de/media/catalog/product/cache/1d080bca42fb631e749cc3891d555069/h/a/handschuh-pu-feinstrick-6618.jpg

and on redesign.company.de I get:

https://relaunch.company.de/media/catalog/product/cache/183b11492b2e7b20f5c77f31599df17c/h/a/handschuh-pu-feinstrick_6618.jpg

As you can see the cache keys are different.

I also cant upload new images, it just looks like this:

enter image description here

and the images does not get loaded in the frontend either.

1

I tend to think this is not a good idea :)

First of all, the media location should be a writable location by the current Magento instance webserver user (this is why you can't upload images from the admin also).

Secondly, it would totally be fine to link the 'media' folder to an external static resources server, but it's not ok to use the same location on 2 different Magento instances. Think about the fact that the media folder not only holds the product images, but also different assets such as captcha images, category images, downloadable products resources, wysiwgyg uploaded assets, cached images, etc. The point is that each of the instances should have its own 'media' folder managed individually.

In order to achieve what you intend to do with the product images, I would suggest you write a customization to sync both the data on products (which product has which image) and also to copy only the product images from relaunch.company.de to redesign.company.de and leave each Magento instance with its own media management (due to the implications already mentioned).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.