Answer the question
In order to leave comments, you need to log in
It causes 404 error and styling issue when going from http to https, what is the reason?
Good afternoon, dear ones!
Did:
1. In the wp-config.php file
define('FORCE_SSL_ADMIN', true);
if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
$_SERVER['HTTPS']='on';
define('WP_HOME','https://osagi.ru');
define('WP_SITEURL','https://osagi.ru');
RewriteCond %{HTTP:X-HTTPS} !1
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
<IfModule mod_headers.c>
# this domain should only be contacted in HTTPS for the next 12 months
Header set Strict-Transport-Security "max-age=31536000" env=HTTPS
</IfModule>
Answer the question
In order to leave comments, you need to log in
Suspicion of cyclic forwarding. Try to dig here .
UPD 1. Now in the code of your HTTPS pages all links are defined as HTTP. And links to publications, and links to styles. When I manually make style addresses in the form href="//osagi.ru/... , the pages look right. I think after that the problems with the redirect will disappear. In general, Google recommends not specifying the protocol in links to resources. .
UPD 2 Check that in the WordPress admin panel in the "General Settings" http was replaced with https . Unfortunately, wordpress does not accept a site address without a protocol, and it is not possible to feed it an address that starts with //.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question