Cannot Get URLS to Write To HTTPS

Hi there,

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

We have 3 separate installs:



I have updated in WordPress settings to https

I have uploaded Better Search Replace and rewritten the URLS http://www.evergreen-hakuba.com to https://www.evergreen-hakuba.com & http://www.evergreen-hakuba.com to 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.jpg
- they all have 2 forward slashes in them…don’t know why?

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

Thanks in advance!

I will include main install logins in a secure note.

Hi There,

Thanks for writing in! This is usually occurring when you add a SSL certificate in the middle of the development process. Basically you need to re-attach your WordPress media files such as images/ background images, audio, video files etc.

You can use the following tool to identify which files that you need to update (https://www.whynopadlock.com/).

Hope that helps.

This is not me doing it in the middle of development, this is adding a SSL cert to a site that has been in production for a long time, and then not being able to fix the URLs.

Just the homepage alone has A LOT of images that need to be redone.

Please offer some other kind of solution…there must be a way to do this other than manual!

Hi There,

In that case, can you try installing a plugin to force SSL. You can try installing the following plugin (https://wordpress.org/plugins/wp-force-ssl/).

Also you can go through some of the recommendations here (http://www.wpbeginner.com/wp-tutorials/how-to-add-ssl-and-https-in-wordpress/).

Hope that helps.

Hi there, I’ve tried several SSL plugins, and been through the tutorial.

The issue isn’t that, it is something to so with the way the URLs are stored in the database making it impossible to update them.

Please note all the URLs that aren’t updating have the path similar to http://www.evergreen-hakuba.com//wp-content/uploads/2017/05/school-winter-02.jpg - notice 2 slashes after .com

Hi there,

Would you mind retrying Better Search Replace then search for the following:

http://www.evergreen
http:\/\/www.evergreen

But kindly make sure to backup your database before you update anything.

Thank you.

Hi Jade,

No luck,

There are still a lot of images loading with 2 forward slashes in the URL eg

http://www.evergreen-hakuba.com//wp-content/uploads/2016/12/EBG_Logo-700.jpg

These are the only ones not being overwritten, but there are a lot of them.

Hi freedomdesign,

It seems like when you clear the image in Cornerstone then reset it again and save the builder, the image is loaded via HTTPS, I’ve done that for several images and I managed to reduce the number of warnings significantly, can you please try doing that with these images?

Thanks.

Hi Alaa,

So you mean manually go in to each page, open in Cornerstone, remove image, add again and resave? This is a big site, is this the only way to fix this?

Hi @freedomdesign,

As I checked your site also, I believe that this is the safest way or the only way you can replace your images. Because if there are other plugins that could help you with this, I believe that it could ruin your site.

Thank you so much for understanding.

I don’t really understand…this has plagued X for so long now…are you saying no one has found a way to update URLs in the database??

I am happy to keep a backup of the database and reupload in case of issues, that isn’t a problem. But making do with having to edit 100+ pages is hard to stomach, especially when this is an ongoing thing…

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.