Home
Support Forums

One Domain Two IP Address?

I am working on a web site. Currently, it’s at Netlify under one of their randomly generated URLs

Eventually, sampledomain.ca will be the domain name.

When people share emails I send on Facebook, Facebook requires a url to an image. I can host the image on my Digital Ocean server.

Is it possible to set things up so sampledomain.ca points to the main site on Netlify and

img.sampledomain.ca.ca or sampledomain.ca.ca/img points to Digital Ocean which hosts the images?

You can indeed create a sub-domain and use it to point elsewhere regardless of the condition whether you’re using Netlify DNS or your domain registrar’s DNS. You might just have to create the required CNAME and A records.

So, pointing img.sampledomain.ca to Digital Ocean is possible while pointing sampledomain.ca/img to Digital Ocean is not possible. I’m considering the double use of .ca in your post is a typo.

However:

It’s not required as such. You can just link without an image too. Also, how big is the image going to be anyways? A few 100 KB right? Why not just link add it to your main domain and host it on Netlify?

Hello,
Currently, I work on the site on my desktop, then commit the changed files, then push to Github. Then Netlify takes over and in a few minutes my site is live.

Are you saying:
When I programmatically assemble a dynamic email and send it out, I also, at the same time, programmatically upload the image to my Netlify account via Github as well? The url in the email points to this Netlify hosted image I think.

I read this about sharing on FaceBook: https://developers.facebook.com/docs/sharing/webmasters#markup
How do I just share a text sentence?

Thank-you

Well, there’s nothing much to do ‘programatically’ in this case. If you know where you’re going to store the image in the website, for example, if you know you’re going to store your image at yourdomain.com/images/emails/email1/img1.png, you can just include that link in the e-mail before you even push the commit to GitHub (I won’t recommend publishing the e-mail before checking if the image is working though). However, if you don’t know the path where your image might exist, you better choose some other way, maybe the Digital Ocean thing you were talking about would help you with that.

What you’ve read there is something that’s recommended, not required. It’s important only if you want to have complete control over how users will see your link when it’s shared. Even if you don’t use Open Graph tags, your website’s links can still be shared, Facebook will try to automatically guess the title, etc. In this case, it might or might not display any image, depending on what it ends up finding on the shared link.

Hi, @lawmalroomcom. It sounds like you want to use Open Graph (OG) tags (specifically, the og:image property) in the site HTML:

If so, this works at Netlify just like it does with any other service. If the OG tags are in the HTML, services that support OG tags will use them.

About this:

When I programmatically assemble a dynamic email and send it out, I also, at the same time, programmatically upload the image to my Netlify account via Github as well? The url in the email points to this Netlify hosted image I think.

What people see in email will depend on the HTML of the email itself. What people see on facebook when the URL is shared there is determined by the OG tag metadata.

About getting Facebook to show only the text and not the image for the shared URL, that is a question about Facebook and not Netlify. I don’t know the answer to that question but someone else here might. (To be clear, I’m saying that is a Facebook technical support question not a Netlify technical support question. The answer is determined by Facebook and is not controlled by Netlify.)

About the DNS question, yes, one custom domain can point to Netlify and a different subdomain can point to another service. This can be done with both DNS methods we support at Netlify. It works for both Netlify DNS and external DNS.

Also, reading between the lines, I think some of the question is: “Can the domain name in the og:image tag URL differ from the sites URL?”

If so, the answer to that question is “yes” based on answer for the Stack Overflow topic below:

If there are other questions about this, please let us know.