WordPress Address (URL) and Site Address (URL) on Lightsail AWS Wordpress Instance greyed out and need to change as have installed SSL cert

0

**WordPress Address (URL) and Site Address (URL) on Lightsail AWS Instance greyed out and need to change as have installed SSL cert **

I installed a cert on the website and now need to -> "Configure your WordPress instance to work with your distribution using SSL/TLS termination" because the WordPress Address (URL) and Site Address (URL) are both http:// and not https://

So I followed the process here

https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-editing-wp-config-for-distribution

and then realised it was looking for the same http:// domains

so I looked again and tried to hard code into wp-config using filezilla direct to the Bitnami Wordpress stack using both the following methods

1 - Change WordPress Site URLs Using functions.php File

Please follow below path and open functions.php file go to /wp-content/themes/your-theme-folder/.

Next, you need to add the following code at the bottom:

update_option( 'siteurl', 'https://example.com' ); update_option( 'home', 'https://example.com' );

2 - Change WordPress Site URLs Using wp-config.php File

Simply open wp-config.php file from your root directory You need to add the following code just above the line that says ‘That’s all, stop editing! Happy publishing’.

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

Neither worked and I thought I had killed the site!

I have not restarted the lightsail instance after making these changes as am worried about being able to access if it goes wrong.

Help greatly appreciated

Jon

MOBJAI
asked 2 years ago2201 views
2 Answers
1

To change the WordPress Address (URL) and Site Address (URL) to HTTPS, you can try the following steps:

Log into the WordPress Dashboard. Go to Settings > General. Change the WordPress Address (URL) and Site Address (URL) to the HTTPS version of your domain name. Click the Save Changes button. If the above steps don't work, try disabling all the plugins and switching to a default theme (e.g. Twenty Twenty-One). Then repeat the steps 1-4.

If you still can't change the URLs, you can try editing the wp-config.php file directly on your server using an FTP client like FileZilla.

Connect to your server using FileZilla. Navigate to the root directory of your WordPress installation. Open the wp-config.php file. Add the following code just above the line that says ‘That’s all, stop editing! Happy publishing’: define('WP_HOME','https://example.com'); define('WP_SITEURL','https://example.com');

Save the file and close it. Try accessing the WordPress site again. It's important to backup your site and database before making any changes to the wp-config.php file.

profile picture
answered 2 years ago
0

I would like to add my experience which appears similiar to like this problem.

  1. I have installed the WordPress, but still I did not open the website either by IP address or by domain name.
  2. I have configured the SSL/TLS of both FQDN and CNAME before open the website.
  3. It worked both by AWS Certificate Manager or Let's encrypt (separately).
  4. Now open the website either by FQDN or by IP address.
  5. Go to the FQDN/wp-admin and open the WordPress.
  6. Now if you close the WordPress and reopen the page - it will take you to the https, instead of http either or WordPress site or FQDN site.

Please configure the SSL/TLS before you open the WordPress either by IP address or FQDN.

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions