1
votes

Steps Taken So far

From https://cloud.google.com/appengine/docs/flexible/php/securing-custom-domains-with-ssl

  1. I have a custom domain.
  2. i have verified a managed certificate has been provisioned
  3. I have upgraded to managed SSL certificates automatically. Thanks Google
  4. I have created a htaccess that Forces SSL
My Problem
  1. After running gcloud app deploy my site goes to http instead of https.

See screenshot below enter image description here

2

2 Answers

0
votes

How's your site_url constant defined in your wp-config.php?

You probably also need to install a Force SSL or Simple SSL plugin. And define corresponding constants in your wp-config.php.

0
votes

The first option is to configure your website to work via HTTPS instead of HTTP. By default, WordPress is redirecting all of other links to the default protocol(in your case HTTPS).

You can configure it via WP-Cli. The command you need is:

wp search-replace 'OLD-URL' 'NEW-URL' --precise --recurse-objects --all-tables-with-prefix

You may check the following tutorial for more information: https://developer.wordpress.org/cli/commands/search-replace/

Another option is to set the 301 redirects in the .htaccess. I am using the following code:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>

Additional information on these types of moves from Google can be found at: https://support.google.com/webmasters/answer/6033049?hl=en&ref_topic=6033084