Cannot Get URLS to Write To HTTPS

Hey @freedomdesign,

We understand this is frustrating but your http to https conversion was successful. Cornerstone is loading everything in https like this one

The weird thing is, the browser requests an http version of it. Also, the mixed content warning seem to be unpredictable. When I checked your home page, there were 3 images that are insecure. I created a test page and copied the exact code from the Raw Content element and also loaded the exact image using a Classic Image element exactly as the home page setup and when I inspected the page’s front-end, there’s only 1 warning.

I inspected your home page again, and there’s now only 2 warnings.

And, I tested if Cornerstone is causing this issue so I just used the WP Editor in another test page and still, the warning persists even if the source is clearly in https

It looks like this is a problem with your SSL setup and not with X. But of course, we need to be sure. Are you using a Cloudflare? Is it OK if you switch to the default WordPress theme and check the test page I’ve made and if the issue persists?

Thanks.

Hi Christian,

Thanks for the detailed reply.

I am not using Cloudflare, the site is hosted with Siteground and uses their caching plugin, that’s all.

I can’t test your page, as you’ve done a total search and replace for http: to https: which has overwritten a lot of URLs to other sites and external links that shouldn’t be https, so I’ve had to go in and restore the backup from before the edits.

I really appreciate your help looking into it, but the only URLs that need to change are those pointing to evergreen-hakuba.com.

Then once I add https to some other company sites I’ll have to come back to this site and try to rewrite those URLs as well.

I don’t believe there is any problem with SSL setup. This is an X site that needs to be made HTTPS, but the URLs don’t overwrite - it seems more to do with the way things are stored in the database looking at other threads.

No standard force SSL plugins work, and I can’t overwrite a lot of database links.

I now have a site that is fine pre-SSL, all I have done is update WordPress settings to HTTPS and I need to make the following changes:

Replace all evergreen-hakuba.com// with evergreen-hakuba.com/
(not sure where the double forward sash came from)

Replace all http://www.evergreen-hakuba.com/ with https://www.evergreen-hakuba.com/

This is easy usually, but something with Cornerstone stops all URLs rewriting.

How can I make this work??

Hi there,

Cornerstone has no rewrite capability, all URLs are provided by Wordpress system especially the media library. I tried it in a test page and image’s URL is correctly added with HTTPS. But please note that already added images (static URLs) will not rewrite itself after you switch your site to HTTPS, you have to do it manually, hence, it’s only normal to see non-secured URL on existing pages (pre-HTTPS pages).

Let’s do some recap, the issue you’re having is images being added with HTTP instead of HTTPS, right? Would you mind providing a video recording of how we could reproduce this issue? I tried this and all images are inserted with HTTPS.

About the MIXED content issue, I can still see them, the URL is needed to be replaced. Should I do that? They are the 3 images in your topbar, the flags in your menu items, and images in the content. You can follow this list for string replacement

http://www.evergreen-hakuba.com/wp-content/ to https://www.evergreen-hakuba.com/wp-content/
http://www.evergreen-hakuba.com/en/wp-content/ to https://www.evergreen-hakuba.com/en/wp-content/
http://www.evergreen-hakuba.com/jp/wp-content/ to https://www.evergreen-hakuba.com/jp/wp-content/
http://www.evergreen-hakuba.com/cn/wp-content/ to https://www.evergreen-hakuba.com/cn/wp-content/

What you need is just replacing the URL of images, hence /wp-content/. And make sure you disable your cache plugin too, and since it’s SiteGround, please make sure it’s built-in cache feature is inactive. Some optimization may have database caching, maybe what we’re replacing is the cache version of your database. Maybe not, but we need to make sure there is no optimization since cache is against change.

Thanks!

Hi Rad,

Thanks for looking at this.

The issue isn’t with new images. The issue is this site was all in HTTP, I have updated to HTTPS and want to rewrite URLs, or do something…even all the SSL plugins aren’t working.

Are you saying there is no way to do this with images that were on the site in HTTP? No way to rewrite database URLs? Everything needs to be done manually? All 50 pages x 3 sites?

I am having trouble believing that…there must be another way!

If not, can I use BSR to replace the URLs one at a time, or do I need to go into Cornerstone and readd all images?

Hello There,

I have done search and replace again and made sure that there are no images that is using http. I even disabled the caching plugin. The issue is still happening. I am guessing that this is because of your Redirections plugin. I haven’t deactivated this plugin yet. If you can deactivate it, or with your permission, we may temporarily deactivate this plugin?

Most of your redirection is using http so the issue must be coming from this settings.

Please let us know how it goes.

Hi there,

I have tried disabling the redirection plugin, no luck. Please take a look, I’ve left it disabled.

Hi,

The problem is when you switch to SSL and replace the url in wordpress settings.
Wordpress will not automatically replace all http to https in your contents.

You have three options

  1. Replace it manually by going through all your contents which is not an option since you have too many to replace

  2. Replace it using a third party plugin like Better Search Replace

  1. Do the search and replace directly in the database.

I would recommend option 2 but as my colleagues have stated that it doesn’t work and that there are still contents with http. Can you provide us your cpanel details in Secure Note I would like to check how the data exactly look like in the database.

Thanks

Hi,

Thanks, yes I realise it doesn’t switch automatically.

As I said in my first message:

I have added SSL to the domain https://www.evergreen-hakuba.com4

We have 3 separate installs:

https://www.evergreen-hakuba.com/

https://www.evergreen-hakuba.com/jp/

https://www.evergreen-hakuba.com/cn/

I have updated in WordPress settings to https

I have uploaded Better Search Replace and rewritten the URLS http://www.evergreen-hakuba.com -> https://www.evergreen-hakuba.com & http://www.evergreen-hakuba.com -> https://www.evergreen-hakuba.com

I still get mixed content errors and several images seem to have the URLs hardcoded. eg http://www.evergreen-hakuba.com//wp-content/uploads/2017/09/Hakuba_Mountains-3000x750.jpg1

  • they all have 2 forward slashes in them…don’t know why?

Please help me get this site to show the secure green lock.

After trying BSR, I looked at plugins - most Force SSL plugins work on most other sites, but they don’t work here either.

Thanks for moving to check out the database. Do you need cPanel login, or can I just upload the database somewhere, I have a backup of it obviously.

Hello There,

I run again a search and replace and I have successfully resolve the CORS issue in your English site.


Since you Chinese and Japanese site is a separate install, you will have to do search and replace in these installations too. And also you must include the urls of your flags too.

In your CN/JP installation, search and replace these keywords:
http://www.evergreen-hakuba.com/jp/wp-content/ to https://www.evergreen-hakuba.com/jp/wp-content/
http://www.evergreen-hakuba.com/cn/wp-content/ to https://www.evergreen-hakuba.com/cn/wp-content/
http://www.evergreen-hakuba.com/canada-flag-64.png to https://www.evergreen-hakuba.com/canada-flag-64.png
http://www.evergreen-hakuba.com/taiwan-flag-64.png to https://www.evergreen-hakuba.com/taiwan-flag-64.png
http://www.evergreen-hakuba.com/japanese-flag-64.png to https://www.evergreen-hakuba.com/japanese-flag-64.png

Please let us know how it goes.

Thank You!!!

For the JP & CN sites, I have got everything working fine thank to your help and by doing a few extra SRs

I had to do a few things several times but all are loading securely!

Thank you all for your help!!!

You’re welcome!
Thanks for letting us know that it has worked for you.

I am having a similar issue. I changed the urls with Better Search Replace Pro and my page was secure and my image urls were https. Then when I save the page with Cornerstone the page shows as unsecure in Chrome and the image urls are back to http. @freedomdesign can you edit a page that @RueNel did a search and replace via Cornerstone and save - you do not need to make a change to the page - just edit via Cornerstone and then save. My guess is the mixed media issues will return. Please let me know.

Hi @jvedder

That is to do with how Cornerstone keeps URLs.

Do the BSR again, but two steps

eg:

Then check, edit in Cornerstone and resave, check again and you should be fine.

Hey There,

As soon as you completer did the search and replace, you should be able to edit the pages with no issues. You can either use Better Search and Replace plugin and I personally suggest WP Migrate DB plugin. There is a search and replace feature of this plugin that works well.

Hope this helps.

@RueNei

You are right, but it’s well known that with Cornerstone you need to do the search and replace twice,

If you don’t do at least this the image URLs rewrite back to http after editing in Cornerstone.

I am sure this will fix the problem @jvedder has. I have done this on 9 sites since this post, and tested it several times, rewriting both URLs is necessary.

@freedomdesign you are brilliant! I just did the rewrite http://www.myurl.com -> https://www.myurl.com in Better Search and Replace. I went into Cornerstone and made a change, saved, and my urls did not change back to http://myurl.com as they previously had been doing. I have been going crazy with this issue. I was unaware the Cornerstone stored the urls in this manner. @RueNel you all need to be aware of this issue. The fix is easy once you know what to do.

Hi there,

Cornerstone doesn’t store it like that, Wordpress is. Some may formatted like that, some aren’t. All data are saved as serialized record and Wordpress do the serialization and not Cornerstone. Cornerstone only uses the resources and functions given by its platform, which is Wordpress.

And yes, you may use http:\/\/ since search replace uses regex and not because it’s stored that way. https://stackoverflow.com/questions/4025482/cant-escape-the-backslash-with-regex

Glad its okay now.

Thanks!

@Rad - Awesome, thanks for explaining the details.

@jvedder glad you have it working!

You’re welcome. Glad we could help.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.