Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Unsecure SSL when using ASP
- This topic has 3 replies, 2 voices, and was last updated 9 years, 1 month ago by
Ernest Marcinko.
-
AuthorPosts
-
April 14, 2017 at 12:03 am #12689
Scholto Bos
ParticipantHi Ernest,
I tried to solve a small problem on my own, but broke my head. I hope you van help me. ASP creates an insecure content warning on the address bar whenever a search is performed.
I checked my settings and they are all good. So the siteurl and homeurl are both set to https://http://www.finler.nl in my database settings.
Next step was to check out my wp-config and I found this multisite setting:
[code]define('DOMAIN_CURRENT_SITE', 'www.finler.nl');[/code]I changed it into:
[code]define('DOMAIN_CURRENT_SITE', '<strong>https://</strong>www.finler.nl');[/code]I thought the problem was gone. Unfortunately I couldn’t access my network admin anymore and on frontend the images do not appear anymore in the ajax search pro results window.
I realised that I added an extra piece of code in my wp-config file
[code]/** Admin over SSL. */
if ( isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) &amp;&amp; 'https' == $_SERVER['HTTP_X_FORWARDED_PROTO'] ) {
$_SERVER['HTTPS'] = 'on';
}[/code]The reason is that my WordPress is hosted behind a reverse proxy that provides SSL. When I not add this code all the requests sent into an infinite redirect loop. pleae see the documentation over here
Bottom line is that I can’t change the DOMAIN_CURRENT_SITE into https:// and that I can’t remove the Admin over SSL code. But i really don’t now how to fix the unsecure notification when using ASP.
I hope you can help me.
Kind regards,
Scholto BosApril 14, 2017 at 9:39 am #12698Ernest Marcinko
KeymasterHi!
I think I know the reason, and a solution as well. So the SSL notification pops-up whevever a search is made. This is because the images might be parsed from the content, and served as-is, with the original non-SSL url.
The resolution is very simple, and since you added FTP acces, I placed the following code to the bottom of the functions.php file in the child theme directory (Avada-Child-Theme), I hope you don’t mind:
This code basically replaces any occurences of http content with https. It will also endure any updates in the future.
I had plans to include this snippet somewhere in the core plugin code, but unfortunately my tests revealed, that in some cases wordpress still reports that the site URL is non-SSL or vice versa, so this would potentially break installations not affected by this issue.
It should return the images with the proper SSL protocol url now.
April 15, 2017 at 11:44 pm #12720Scholto Bos
ParticipantHi Ernest,
Thanks for the quick and great support! You can close the ticket.
Kind regards,
Scholto BosApril 16, 2017 at 7:59 am #12723Ernest Marcinko
KeymasterYou cannot access this content.
-
AuthorPosts
- The topic ‘Unsecure SSL when using ASP’ is closed to new replies.