WordPress over https on apache and ubuntu not working on vanilla setup
-
My configuration:
LInux Ubuntu Server 18.04 LTS amd64
apache2 2.4.29-1ubuntu4.11
mysql-server 5.7.29-0ubuntu0.18.04.1
php 7.2+60ubuntu1
php7.2-common 7.2.24-0ubuntu0.18.04.2wordpress 5.3.2–hr
Server almost default install, WP default install, wp-config.phph basic.
Set apache configuration of virtual host for http and https.
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName kviz.sfsb.hr
DocumentRoot /var/www/kviz
<Directory /var/www/kviz>
Options -Indexes
</Directory>
</VirtualHost><VirtualHost *:443>
ServerName https://kviz.sfsb.hr
DocumentRoot /var/www/kviz
<Directory /var/www/kviz>
Options -Indexes
</Directory>
</VirtualHost>.htaccess file empty
Right after installation when I access WP by https – https://test.domain.com I get frontend (default 2020 theme applied), login and admin area totally messed up, like no CSS exists.
I tried this solution for admin area:
define(‘FORCE_SSL_ADMIN’, true);
// in some setups HTTP_X_FORWARDED_PROTO might contain
// a comma-separated list e.g. http,https
// so check for https existence
if (strpos($_SERVER[‘HTTP_X_FORWARDED_PROTO’], ‘https’) !== false)
$_SERVER[‘HTTPS’]=’on’;but results are same – seems there is no CSS.
When I add lines:
define( ‘WP_HOME’, ‘https://kviz.sfsb.hr’ );
define( ‘WP_SITEURL’, ‘https://kviz.sfsb.hr’ );to wp-config.php I get error message:
The page isn’t redirecting properly
I searched many sites and tried many solutions but I’m stuck now.
I would like to get working at least admin and login areas.The page I need help with: [log in to see the link]
- The topic ‘WordPress over https on apache and ubuntu not working on vanilla setup’ is closed to new replies.