M
M
Mars2020-05-13 13:42:37
PHP
Mars, 2020-05-13 13:42:37

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 . '>'

What needs to be done so that all styles, scripts and images open via https?
Here is the site itself: gmm.su

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Mars, 2020-05-13
@Marsseo73

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/',

I
Irina, 2020-05-13
@iitovka

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 question

Ask a Question

731 491 924 answers to any question