N
N
Nikita2021-07-21 15:15:37
htaccess
Nikita, 2021-07-21 15:15:37

Why does the Mixed Content error occur when redirecting from internal pages to the main page?

Hello! I set up a rule in htaccess for redirects from all internal pages to the main one:

RewriteEngine on
RewriteCond %{REQUEST_URI} !^/$ [NC]
RewriteRule (.*) / [R=301,L]

The rule works, but now I get the following error in the browser: Mixed Content: The page at ' https://site.ru/ ' was loaded over HTTPS, but requested an insecure stylesheet ' site.ru '. This request has been blocked; the content must be served over HTTPS.
Accordingly, although the main page is loaded, not a single file is loaded, neither styles, nor pictures, nor js. The site has an SSL certificate.
As I understand it, you need to somehow set up redirects for all pages, except for certain files with an extension?
Please help me write this rule.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question