I was facing some hard time configuring the SSL for my Primary Domain and Subdomain and forcing HTTPS link over HTTP:

I generated the SSL Let's encrypt certification and then found a solution to add to .htaccess:

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Now after adding this, my issue of SSL is resolved but I can see some new error on google analytics setup via Site Kit Plugin, while trying to setup the Google Analytics, its shows the following error on WordPress Admin Console:

Error: {"error":"invalid 'redirect_uri'"} 
  • I assume you also modified the site URL under "Settings | General" in your Dashboard and changed http to https for both URL & Homepage? Jun 4, 2020 at 6:22
  • Thanks, replacing the links worked, Google Analytics is processing further and not showing the same error it was showing earlier. Any idea why Google analytics is throwing this error now : Error: Account token is missing. Jun 4, 2020 at 7:10
  • Glad you got it fixed. It's an common mistake when going from http to https. Unsure why the account token is missing. Now you are https, I'd remove site kit and re-install and activate it. Then follow the directions it gives you. You need to connect some of their services. Jun 4, 2020 at 8:22
  • I'll add my comment about site url as an answer. If you're happy it answered your question, mark it as correct. :: Jun 4, 2020 at 8:23

1 Answer 1


One of the more common mistakes people make when moving Wordpress from http to https is not letting Wordpress know about the change.

The most important parameter used by Wordpress, when creating URLs or Links around your site is, "Wordpress Address (URL)" and "Site Address (URL)"

Both of these can be found within your Dashboard under "Settings | General". Changing the http:// component of the URL to https:// will likely solve your problem.

Wordpress uses these parameters to build, on the fly, appropriate links and URLs for your site. For example, it might record a path in your database as /images/companylogo.jpg but will add https://example.com at the beginning to form a valid address.

Other potential issues

If you have done that and get "Mixed Content" errors from your Web Browser then the likely cause is a dodgy plugin. Plugins recording full URLs including the http:// rather than getting the site URL from Wordpress will give "Mixed Content" errors.

In cases like this it is sometimes necessary to export your database as a text file and search for references to http and change them to https. Of course you need to be careful because not all references to http are incorrect. Once you are happy, delete your original database tables and import from your newly saved text file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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