Home › Forums › General issues › Excluding links from https override
- This topic is empty.
-
AuthorPosts
-
February 17, 2016 at 9:38 pm #822
Mathieu Bl
GuestHello,
I have an iframe on my homepage which src is from another wordpress that is not https.
<iframe class="wp-embedded-content" src="http://otherdomain.com/something" width="500" height="523"></iframe>';
Simple SSL changes the src to https://otherdomain.com/something thus the iframe doesn’t load.
I have search the doc for a way to exclude this specific link, but it seems it’s not working (I did try to add a filter function to rlrsssl_replace_url_args).
Do you have any clue on how I could achieve this?
Thanks.
February 17, 2016 at 10:58 pm #823Rogier
KeymasterI guess this should work. Use the filter to remove the src=”http from the array. You could edit this by adding a condition as well.
function my_custom_http_urls($arr) { global $post; if ($post->ID = 20) { unset($arr["src='http://"]); //or, if double quotes were used: unset($arr['src="http://']); } return $arr; } add_filter("rlrsssl_replace_url_args","my_custom_http_urls");
February 19, 2016 at 3:59 pm #826Mathieu Bl
GuestHello again,
Thanks for the answer. Sadly, it doesn’t work. I also cannot use global $post as the link I’m trying to remove from the array is from another domain.
I wouldn’t mind if I could just get an array of all the urls that are going to be changed to https. This way I could remove specific full urls from the array.
February 20, 2016 at 11:21 am #827Rogier
KeymasterThe mixed content doesn’t work that way: creating an array of all links to be replaced before replacing them would be too slow and complex.
So it works by replacing all src=”http://, and uses regex patterns as well.
In your case, your options seem to be: either disable the mixed content fixer, remove the video, or moving the video to an ssl environment.
You can of course also look for a different plugin, I think there are plugins which offer more configuration options, at a performance price of course.
January 5, 2017 at 6:12 pm #21891daniel
Guesthi guys, im using this plugin and solve me life!
but i have an iframe in some post that the plugin rewrite the url to https.
i put this code in the function php but dont work.
function rsssl_exclude_http_url($html) {
$html = str_replace(“https://www.domain.com”, “http://www.domain.com”, $html);
return $html;
}
add_filter(“rsssl_fixer_output”,”rsssl_exclude_http_url”);the url of the iframe for example is
<iframe src=”https://data.bolavip.com/fsnbolavip/html/v3/index.html?channel=deportes.futbol.ecuador.posiciones&lang=es_LA” width=”100%” height=”500px” frameborder=”0″></iframe>
January 5, 2017 at 6:30 pm #21895daniel
Guestsorry i put wrong the url. the original url is http://data.bolavip.com/fsnbolavip/html/v3/index.htm……. and the plugin rewrite to https….. thanks
January 9, 2017 at 10:35 pm #22131Rogier
KeymasterSorry for the late response, missed your post!
You need to change domain.com to the url you don’t want https:
function rsssl_exclude_http_url($html) { $html = str_replace( 'https://data.bolavip.com/', 'http://data.bolavip.com/', $html); return $html; } add_filter('rsssl_fixer_output','rsssl_exclude_http_url');
June 2, 2017 at 4:09 am #39384Rob Buller
Guestwhich functions file is this supposed to go in? I tried the one in my theme and it broke my site.
June 4, 2017 at 9:26 pm #39655Rogier
KeymasterThe location was probably right, I think the issue was that the texteditor does something strange with the double quote in my function, which might prevent it from being recognized as such, which breaks the script. I’ve now changed the quotes into single quotes, which seem not to be changed by the texteditor.
May 17, 2019 at 3:06 pm #226443dadiaoge
Guestthinks,it is work!
-
AuthorPosts
- The topic ‘Excluding links from https override’ is closed to new replies.