I've this code in .htaccess file, and facing lots of mixed content error after installing ssl certificate.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteRule ^\/(fractuosity)([0-9]+)\/(.*)([0-9]+)\/(.*)$ ?fractuosity$2=$4&%{QUERY_STRING}[L]

RewriteCond %{HTTP_HOST} celestialspaceindia\.com [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://celestialspaceindia.com/$1 [R,L]


enter image description here

  • You need to use a database migration / search and replace plugin to replace all instances of your HTTP URL with the HTTPS one. Otherwise your database is still pointing to the old insecure URLs.
    – WebElaine
    Oct 11, 2018 at 15:13
  • But I cannot access wp-admin to add any plugin
    – Yogesh
    Oct 11, 2018 at 15:19
  • Change your .htaccess file back, clear your browser cache, add the plugin, replace HTTP with HTTPS everywhere, and then restore .htaccess to enforce HTTPS.
    – WebElaine
    Oct 11, 2018 at 15:20

1 Answer 1


I'd put the HTTPS redirect at the top of the htaccess file, not after the WordPress elements. See this page in the Codex for htaccess suggestions: https://codex.wordpress.org/htaccess . You need to redirect to https first before doing the WP rules in htaccess.

You may also need to change any http to https in your database. I use a plugin like "Better Search and Replace" to do that, there are other similar options.

And make sure that you change the URL in the wp-option table to https (in two places).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.