Reputation: 1011
I am trying to setup HTTPS Protocol on my Wordpress website but first, I'd like to test it on localhost, to be sure it will be fine once the website is online. I am using ngrok to get self signed certificates .
I want my demo website to be like :
I tried many things so far but without success :
RewriteRule ^(.*)$ https://localhost:8080/mywebsite/$1 [R,L]
define('WP_HOME', 'https://localhost:8080/mywebsite');
define('WP_SITEURL', 'https://localhost:8080/mywebsite');
define('FORCE_SSL_ADMIN', true);
$_SERVER['HTTPS'] = 'on';
Sometimes I get access to my homepage, but without any images and js (because of wordpress permalink I suppose). Trying to access to other pages give me a 301 Moved Permanantly
error
Upvotes: 2
Views: 4525
Reputation: 12524
Sometimes I get access to my homepage, but without any images and js (because of wordpress permalink I suppose)
You need to make sure you are loading all resources over https and this includes images. Your browser will block resources that aren't loaded over https.
You will need to do a find and replace on your database to change any entries of http://localhost to https://localhost.
I recommend using this tool to perform the search and replace as it will account for serialized strings in your database.
Make sure to backup your database before doing the find and replace.
Upvotes: 1
Reputation: 449
In your database, ensure the site URL is correct (including https://) in the options table - by default this table is called wp_options.
Look for the two records where the option_name = siteurl and option_name = home.
Upvotes: 1