Which URL is used by the installation as siteurl and as home? I suspect there is a difference here. You should be able to see the information if the backend does not work, e.g. when calling /wp-json/. Or you can look in the database via phpmyadmin.
Another possible reason could be a plugin you have installed.
You also say that it works locally on your site. Have you moved the project from your local site to the current hosting? If so, which path did you take?
Thread Starter
sgt621
(@sgt621)
According to the db, siteurl and home in wp_options are set to the same value: http://mysite.com
I have not gotten to a point where I can install plugins. Not sure if there are some installed by default.
I did a clean install on localhost, then did a clean install on GCP (Google Cloud). The steps are the same, with the exception that GCP has increased complexity built in.
-
This reply was modified 1 year, 7 months ago by
sgt621.
-
This reply was modified 1 year, 7 months ago by
sgt621.
Presumably a component of the server will then forcibly redirect you to https, but WordPress is not configured for this. Change the configuration in WordPress to https, then it should actually work.
Thread Starter
sgt621
(@sgt621)
I added the following lines to wp-config.php, but I don’t see different behavior:
define('FORCE_SSL_ADMIN', true);
define('FORCE_SSL_LOGIN', true);
As far as I know, this only causes a redirect, but does not change the URL. If you are already in wp-config.php, you can also store the customised site URL and home there, see: https://developer.wordpress.org/advanced-administration/upgrade/migrating/ (section ‘Edit wp-config.php’)
Moderator
Yui
(@fierevere)
永子
Warning: Use of undefined constant WPLANG – assumed ‘WPLANG’ (this will throw an Error in a future version of PHP
WordPress does NOT use this constant anymore. Please remove string define(‘WPLANG’ …) from your wp-config.php