Converting sites from http to https

I finally decided to move my sites to https, but each site has a huge number of assets (jpg images) stored on an http server. I understand that one cannot, for security reasons, have images from an http server on an https site. So, I will need to change the server to https, but all of the URLs for these images in Blocs are http. Is there a way to list all of those images URLs and perhaps do a find and replace http for https? I am using Cyberduck and there doesn’t appear to be a way to do this there unless I copy each URL or group into TextEdit and do the find and replace there, but I have nearly 1500 image folders and probably 8-9000 images. (among two sites).

The root folders are the same, most hosting should be able to automatically redirect http://url to https://url
It’s more of a change only in the provider’s hosting server settings. Today https is a matter of course and a necessity, many internet browsers automatically block http access.

Thanks. I think the only “easy” way is to embed the existing assets. But, that isn’t working. When selecting Embed All Project assets in the Assets drop-down, it says the assets have been embedded, but they are not. They are still being hosted. And when selecting “Yes” to the question in the next pop-up “All assets have now been embedded into this Blocs project file. Would you like to enable automatic asset embedding for any assets that are added to this project in the future?”, Blocs crashes.

First I would check if the images are stored with full qualified URLs (including the protocol http) or by relative URLs.

When my hosted images are imported into the Asset Manager, they have the full http://url. I don’t know where they are stored with the url to check to see this. In the Asset Manager only the file name is shown.

Even if Blocs wouldn’t crash and you successfully embedded all 9,000 images into your .bloc file, it still won’t solve your issue.

Embedding an asset only changes where the image file is stored (inside the .bloc project file instead of linked externally). It does not rewrite the image URLs assigned to your elements. If an image element is set to fetch http://your-server.com/image.jpg, Blocs will still output that exact http:// link in the exported HTML code—embedded or not.

Since Blocs doesn’t have a global search-and-replace feature for external image URLs, attempting to fix this inside Blocs means manually updating 9,000 links one by one. Or am I missing something?

The Only Practical Fix (10 Seconds)

Leave your Blocs project untouched, export the site, and update the URLs in the final HTML code right before uploading:

  1. Export your site from Blocs to a folder on your Mac.
  2. Open that exported folder in a free code editor (like VS Code, BBEdit, or Sublime Text).
  3. Press Cmd + Shift + F to open global Search & Replace.
  4. Search: http://your-image-server.com/
    Replace: https://your-image-server.com/
  5. Click “Replace All” and upload the exported folder via Cyberduck.

(You’ll need to run this quick Search & Replace step whenever you re-export the site, but it updates all 9,000 links instantly and avoids any app crashes).

Thank you! I will give it a try today. Too bad the search and replace function isn’t available within Blocs, but this should solve my immediate problem.

Are you using Apache? If yes, this htaccess code would serve http linked images automatically with https.

<IfModule mod_headers.c>
Header always set Content-Security-Policy "upgrade-insecure-requests"
</IfModule>
1 Like

Thank you. My web guy made the changes, fairly straightforward for him doing something like you suggested. He also moved everything to an AWS S3 bucket. SSL is included so now all my sites are https. Woohoo!

3 Likes