Dimentica
Dimentica

Reputation: 805

Use SSL in wordpress site

I want to go from HTTP to HTTPS on my wordpress site. So far, I have done the following:

  1. Changed the siteurl and home addresses to https://www.example.com
  2. In wp-config.php file added

    define('FORCE_SSL_ADMIN', true);
    define('FORCE_SSL_LOGIN', true); // I read this was deprecated, but I was desperate
    /* That's all, stop editing! Happy blogging. */
    
  3. In .htaccess I have:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTPS} !=on
    RewriteRule ^https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    

So now I face two problems: 1. css styles do not load 2. I cannot access wp-admin panel and I have error 401 The page isn’t redirecting properly

I`ve tried a lot of things and finally I really need your help, thanks!!!

EDIT!!!! I removed the lines define('FORCE_SSL_ADMIN', true); define('FORCE_SSL_LOGIN', true);

and now it finds its way to the admin panel, but still the style files are not loaded.

Upvotes: 2

Views: 445

Answers (1)

aimadnet
aimadnet

Reputation: 423

Just use a Wordpress Plugin, it will save you time.

I use personally this one: https://wordpress.org/plugins/wp-force-ssl/

Upvotes: 1

Related Questions