Question

Why does switch from http to https on wordpress droplet stops showing website?

Posted September 1, 2020 225 views
WordPress

I have spent all day trying to get a website to show its ssl. Everytime i got to wordpress settings and change the s on http the website will not show and i cant gain access to it through the bowser or console. I am using wordpress one click installer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
3 answers

Hi @devjourney,

Where exactly are you changing the said setting exactly? Additionally, when you change it to https, what happens, the website stops loading like it can’t reach it at all or you are experiencing an error of some sort?

There are usually 2 thins that can happen. The redirection from http to https breaks your website due to some plugins or something similar or that you don’t have anything listening on port 443 and thus trying to connect via https doesn’t work. Once you let us know the error you are experiencing, I’ll be able to provide you with more insight.

Regards,
KFSys

Hi,

Thanks for the reply. I am making the changes on the Wordpress admin settings. This is after I have used Certbot through the console.

It immediately kicks me out, which is expected. The website still shows on the ip and the domain name but there is no access to domain/wp-admin or login and the error connection timed out.

Weirdly enough I don’t seem to be getting any droplet details to my emails either.

Regards
Adam

  • Hi @devjourney,

    Hmm, I see. I take it, it now loads with HTTPS, rather than HTTP, correct?

    It seems like changing the settings to be from HTTP to HTTPS from your admin area isn’t working. You might need to hardcode them in your wp-config.php` file, or edit them straight into your database.

    Let’s assume you wish to try out the first thing I mentioned as it’s easier - editing your wp-config.php file.

    Open your WordPress config file wp-config.php in your favorite text editor. Then add the following two lines to that file, at any position above the line /* That’s all, stop editing! Happy blogging. */:

    define( 'WP_SITEURL', 'https://domain.com' );
    define( 'WP_HOME', 'https://domain.com' );
    

    The above two lines force your WordPress to use HTTPS instead of HTTP without touching any WordPress Dashboard settings. Now you can open your WordPress site using the url https://domain.com/ instead of http://domain.com/ as before.

    Regards,
    KFSys

Hi @devjourney:

You must first confirm that your SSL setup is correct. Let create a file hello.html at your website’s document root with any text content, such as Hello world!:

  • echo 'Hello world!' | sudo tee -a /website/document/root/hello.html

Make it readable so your web server can read it:

  • sudo chmod 644 /website/document/root/hello.html

Now, open this url in your browser: https://yourwebsite.com/hello.html

If you see the Hello world! message, then your SSL setup is correct. If not, correct your SSL setup before moving on to the next step. Subsequently, finish this first step by deleting the hello.html file:

  • sudo rm /website/document/root/hello.html

Assuming that your SSL setup is correct, now switch your WordPress site from HTTP to HTTPS. Open your WordPress config file wp-config.php in your favorite text editor. Then add the following two lines to that file, at any position above the line /* That's all, stop editing! Happy blogging. */:

define( 'WP_SITEURL', 'https://yourwebsite.com' );
define( 'WP_HOME', 'https://yourwebsite.com' );

The above two lines force your WordPress to use HTTPS instead of HTTP without touching any WordPress Dashboard settings. Now you can open your WordPress site using the url https://yourwebsite.com/ instead of http://yourwebsite.com/ as before.

Regards,
Tom Nguyen

Submit an Answer