L
L
Lici2015-07-02 10:03:35
cloudflare
Lici, 2015-07-02 10:03:35

WordPress + HTTPS = broken admin?

I put CloudFlare on the site, it opens via https, went to the admin panel and entered the site url with https there. The site itself opens, but the admin panel does not. No reaction.

What did I do wrong and how can I get it back?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Marat, 2015-07-02
@7kmarat

In wp-config.php paste this

/** SSL в панели администратора */
define('FORCE_SSL_LOGIN', true);

/** SSL в панели входа */
define('FORCE_SSL_ADMIN', true);

And in the database, replace all your links from http to https
UPDATE wp_posts
SET post_content = REPLACE (post_content, 'http://старый.ru', 'https://новый.ru')

UPDATE wp_postmeta
SET meta_value = REPLACE (meta_value, 'http://старый.ru','https://новый.ru')

UPDATE wp_posts
SET guid = REPLACE (guid, 'http://старый.ru', 'https://новый.ru')

UPDATE wp_posts SET post_content = REPLACE (post_content, 
'src="http://старый.ru', 'src="https://новый.ru');

in .htaccess make redirects from http to https
where it says mysite insert your site address
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?mysite\.ru$ [NC]
RewriteCond %{HTTP:X-Forwarded-Proto} !=https
RewriteRule ^(.*)$ https://mysite.ru/$1 [R=301,L]

P
Puma Thailand, 2015-07-02
@opium

There, cloudflare passes a parameter that indicates that it is http, put a plugin that catches it, search for the phrase cloudflare https

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question