Answer the question
In order to leave comments, you need to log in
Why doesn't a PHP site work with an SSL certificate?
I installed a site in PHP on the hosting, everything works fine, but does not want to work through an SSL certificate. A common problem is when scripts and css do not work over SSL. I solved this problem with sites on CMS more than once, but I encountered PHP for the first time and I don’t know what to do))
I tried to configure it through .htaccess, but the site simply stops opening.
It turns out that scripts and styles are opened through port 80 - https://site.ru:80/... and, accordingly, are not available.
It seems like these codes are responsible for this in the AssetManager.php file:
1. $html = '<script id="' . $id . '" type="text/javascript" src="' . $assetURL . '"'. $extra . '></script>'
2. $html = '<link rel="stylesheet" id="' . $id . '" type="text/css" href="' . $assetURL . '"'. $media . '>'
Answer the question
In order to leave comments, you need to log in
Everyone solved the problem on their own. In the \src\settings\app.php file, I changed it
to
Naturally for the place mysite.ru, indicating my domain. Thank you all for your help.
'uri' => false,
'uri' => 'https://mysite.ru/',
If the site opens via https, then it should also open via http - for starters, then a redirect is made from http to https. if you set https, it does not mean that you need to close http altogether, because someone can manually type in the site address but with http.
In the addresses of images and styles, you do not need to specify the protocol at all, just the address from the site root.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question