P
P
Pavel2017-03-06 13:20:21
Digital certificates
Pavel, 2017-03-06 13:20:21

How to migrate WordPress to a domain with SSL?

I am transferring the site from local to hosting. I changed the old domain in the database to a new one with http: - the site works (the browser really swears that it is unsafe, etc.), but I can’t log in - after submitting the form, the page simply reloads. Changed the domain in the database to https: - after that the site does not work at all, the error "ERR_TOO_MANY_REDIRECTS" is issued. Tried adding to wp-config.php define('FORCE_SSL_ADMIN', true); - gave no result.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Kozlov, 2017-03-06
@Palych_tw

Faced with such garbage more than once. Another difficulty is that redirects are cached at different levels. And it's better to check through third-party services, like bertal. Goes to the right page.
By transfer:
1 - change the urls from http to https. Better to do it with a plugin.
2 - Just in case, add to wp-config :)

define('WP_HOME', 'https://mydomen.ru/');
define('WP_SITEURL', 'https://mydomen.ru/');

3 - add to wp-config.php
4 - Well, most likely it will help to add to wp-config (I add to the beginning of the file):
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && 'https' == $_SERVER['HTTP_X_FORWARDED_PROTO']) {
    $_SERVER['HTTPS'] = 'on';
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question