changing URL of pictures(files)??

Kevin_P1
New Member
1 0 0

When I upload files to my site, I want them to have a base URL that matches the domain of my site - not cdn.shopify.com...

Is this possible? How? 

 

0 Likes
vix
Shopify Staff
Shopify Staff
535 105 107

Hi Kevin!

You can not change the URL of the photo once it has been uploaded to the CDN. If you are looking to improve your SEO you do not need to change the URL but simply the name of your photo before the upload. Let's take this file for example: 

https://cdn.shopify.com/s/files/1/0871/5018/files/IMG_TEST.jpg?6063292354730161308

The file name is IMG_2395.jpg which would be considered in ranking for SEO. If you change the file name of the image to "your-keyword" and you'll be more likely to show up in rankings.

Hope that helps!

Victoria 

Vix | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

0 Likes
victorien
New Member
3 0 0

Hi Victoria,

And thanks for this answer,

I have the same problem as Kevin. I want to change the url of my image, to have mydomain.fr instead of cdn.shopify. The reason why I want to do this is for backlinks.

Let me explain, I have some external website how use my images. I publish my image with a common right, but in return I ask for a link to my images.

At this time, you guess that those links go to cdn.shopify and not to my website. So, I search a solution to get these links to point to my domain name.

I came back to you if I found a solution

Otherwise, I hope you will bring me a solution

Thanks for your attention and continue your good work

Sincerely,

Victorien

0 Likes
FilipposD
Excursionist
29 1 7

A solution to this is:

  1. The link to your site will not point to the image itself (CDN) since you don't want that, but to another URL
  2. If the URL has no params, then you would have to create a page for each image in Shopify
  3. But, since this is not a good idea, the link will point to a specific page, and a URL param e.g. "filename" (myshopifysite.com/images?filename=a-cat.jpg)
  4. Liquid can't read the param, but Javascript can; so you create the page "images" and include a script that reads the filename param, and fetches the particular image.
  5. Along with the image that will load with JS and be displayed, you can have anything else you like on that page 
0 Likes
victorien
New Member
3 0 0

Hello @FilipposD,

thank you for your answer,

If I understand well, this manipulation will change each pictures on my website.

  • When I right-click on an image inside my block and open the image, the url will be "myshopifywebsite.com/nameofthepicture.jpg" ?
  • Do the speed of my website will be impact ? If so, how much ?
  • How can I proceed ?

After few searches, I think that changing each cdn.shopify into a myshopifywebsite.com is not a good idea for two reasons,

  1. My website will be slower because cdn.shopify have a lazy load for each of them images 
  2. My seo will be impact from this slowness

My dreamed solution will be in my case to :

  1. see which images of cdn.shopify is already used by another web site
  2. add the image already used on a single new page with the url: "myshopifywebsite.com/image/nameofthefile.jpg" H1: "nameofthefile.jpg" alt: "nameofthefile.jpg"
  3. contact the webmaster of the website and ask him to link to "myshopifywebsite.com/image/nameofthefile.jpg"

Just to remind, the purpose of this manipulation is just to catch backlinks and optimize my DA. I don't want the page "myshopifywebsite.com/image/nameofthefile.jpg" to be reach by a normal user from my website. The only way for someone to reach this kind of page will be by the SERP of google image. So if I can do so with your technics, please explain step by step how to do this or share a link of someone who explain it.

Thanks for your attention,

Sincerely,

Victorien

0 Likes
FilipposD
Excursionist
29 1 7

With my proposed solution, nothing will happen to the existing images from the CDN.

The only thing you will add to your store is a new page, e.g. /image (if you don't have a link to it in your site, nobody will go there).

The solution you mention is similar to mine, but in your case you have to create a page for each image. What I said is, create a single page, where a script will fetch and display the image from the CDN.

The result is:

  1. A third party website will still display the image from the CDN
  2. But you can contact them and tell them to add a link to your site, with this format: "mysite.com/image?filename=name-of-image-file"
  3. When Google crawls the third party site, it will follow this link back to your site
  4. On your site, in the new page, JavaScript will fetch the CDN image to display it

Now the part I'm not sure about: I don't know if Google will index the page with the image, so the image can appear in image search results. Google is supposed to be able to run JavaScript, thus able to see the image fetched in the new page. Users, if following the link from the third party site, certainly will.

0 Likes
victorien
New Member
3 0 0

Hi @FilipposD,

If everything you are telling me is true, then your solution is obviously the best.

I want to try it on my website, but for this I need further information. I have basics skills in CSS and HTML, but I never used JavaScript. So if you can send me the exact code and tell me where I should insert it on shopify it will help me. 

A big thank you for your help, I cross the finger for the indexation of those pages

0 Likes