Mixed Content: The page at / SSL

You can specify a redirect to https only two pages of the shop / university, but that does not redirect style css / js files. This code works, but at the same time get a lot of errors:

Mixed Content: The page at 'https://www.example.com/shop/' was loaded over HTTPS, but requested an insecure stylesheet 'http://www.example.com/wp-includes/css/admin-bar.min.css?ver=4.4'. This request has been blocked; the content must be served over HTTPS.

If you comment out the last line, the https styles normal, but on the other pages there is no redirect to http

#RewriteRule !^(shop|university)(/.*)?$ http://%{HTTP_HOST}%{REQUEST_URI} [NC,R=301,L]

this code in .htaccess

<IfModule mod_rewrite.c>
RewriteEngine On

RewriteCond %{HTTPS} off
RewriteRule ^(shop|university)(/.*)?$ https://%{HTTP_HOST}%{REQUEST_URI} [NC,R=301,L]

RewriteCond %{HTTPS} on
RewriteRule !^(shop|university)(/.*)?$ http://%{HTTP_HOST}%{REQUEST_URI} [NC,R=301,L]

</IfModule>

Upvotes: 0

Views: 1122

Answers (1)

Croises
Croises

Reputation: 18671

As I explained to you in your other question:

In your pages, you must use links relative to the root:

/wp-includes/css/admin-bar.min.css

Or without protocol:

//www.example.com/wp-includes/css/admin-bar.min.css

But never use http: in https pages

Upvotes: 1

Related Questions