Answer the question
In order to leave comments, you need to log in
How to change someone else's image from HTTP to HTTPS?
Hello. Straight to the point. I have a website with ssl certificate installed but images without certificate. The problem is that the images are of course blocked because of the mixed connection.
I even experimented. that is, uploaded the image to the server, and then output it as https
Here:
if(isset($_GET['link']))
{
$header = get_headers($_GET['link']);
if(isset($header[2]) && $header[2] == 'Content-Type: image/jpeg')
{
header('Content-Type: image');
$lines = @file($_GET['link']);
$file = fopen($_SERVER['DOCUMENT_ROOT'].'/imgitem/cache/'.md5($_GET['link']), 'w');
if($lines != NULL)
{
foreach ($lines as $line_num => $line) {
echo $line;
}
}
}
}
Answer the question
In order to leave comments, you need to log in
Alien - no way.
As an option, you can consider the possibility not to parasitize on someone else's content, but to do something of your own
php proxy on the git, lots of examples
and strreplace everything ;)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question