0

By the default Magento save the images to: www.domain.com/media folder

i would like to change the location of the saved images to subdomain: images.domain/media

I have made changes through the configuration: configuration -> web -> Base Media URL and have cleared the catch, but the images are not uploading. Also, i have made change the permission for the folder 777.

any idea what i'm doing wrong and how this can be done?

updated 12.09.2015. i found the following, which is exacly what I did, but this is not working:

Create a Sub-domain named "media.mytestsite.com". Copy the media folder to your sub-domain's root folder. Give the permission 777 to media folder. (Full permission). Go to you magento admin. Go to System -> Configuration -> Web -> Unsecure -> Base Media URL and put "http://media.mytestsite.com/media/". Go to System -> Configuration -> Web -> Secure -> Base Media URL and put "https://media.mytestsite.com/media/". Now save the configuration. Clear/Refresh magento cache.(It is very important) You have done it all... :) Enjoy..

3
  • What do you mean by "the images are not uploading?". What is the error msg? What does var/log/system.log say? Or is there even an exception? Make sure to test another browser for uploading images. – Nicolas Sep 12 '15 at 11:58
  • when i try to add a product and upload the image, the image is not uploaded. This is happening only if I change the location for images to: images.domain.com/media. I sow that some website have different location path for the media, and I assume this could be changed. But if I leave it as it is: www.domain.com/media, the images have been generated and everything is working just fine. I need to change the path of image upload location. My case a subdomain: **images.domain.com/media ** system log file, doesn't provide any info about this. – user15151 Sep 12 '15 at 13:28
  • Make sure your media folder is still inside Magento's folder otherwise Magento can't write into it - it's not a matter of the folder's permission at that time but your HTTP daemon will not grant access to write files outside of it. I suggest you keep the media files inside Magento's folder structure and simply map a subdomain to the corresponding magento/media folder. – Nicolas Sep 13 '15 at 6:17
1

Create a Sub-domain named "media.mytestsite.com". Copy the media folder to your sub-domain's root folder. Give the permission 777 to media folder. (Full permission). Go to you magento admin. Go to System -> Configuration -> Web -> Unsecure -> Base Media URL and put "http://media.mytestsite.com/media/". Go to System -> Configuration -> Web -> Secure -> Base Media URL and put "https://media.mytestsite.com/media/". Now save the configuration. Clear/Refresh magento cache.(It is very important) You have done it all... :) Enjoy..

These are instructions for having the front end put the sub domain for img src tags. As for uploading images in the admin panel... this is a different story.

If this is a dedicated web server, you can simply make your sub domain vhost and point it to your document root. This would be my suggestion.

If your subdomain is a different server or on a cheap cpanel server, then your going to have to script something or use rsync to transfer the images from the main site to the sub domain site every 5 minutes or so.

There are also modules available that might do this stuff automatically for you. You would need to look into cdn modules and see what's available an what fits your needs.

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.