Forum Moderators: phranque

Message Too Old, No Replies

Switching to SSL

What to do with non-https objects?

         

lzr0

5:47 pm on Jul 18, 2018 (gmt 0)

10+ Year Member



Hi,
I just realized that https page will not load any non-https object (such as css, js, etc). Do I need to manually change all these urls to https on all my pages one at a time, or there is a smarter way (say, through htaccess)?
To be exact, those objects that have a relative url do load, only those with full url would not (for example, sub-domains refer to css file in root directory with full url pass).

Dimitri

1:50 pm on Jul 26, 2018 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member Top Contributors Of The Month



BTW - SSL is no longer used. It was replaced with TLS

More than replaced, it's banished since 2014. But I guess that people will continue to talk about SSL , ... the same way people (and this forum) continue to use GMT, in spite of the fact that it was replaced by UTC in ... 1972.

lzr0

5:37 pm on Jul 26, 2018 (gmt 0)

10+ Year Member



Don't "worry" for them.


OK, now I will not. (-:

lzr0

5:47 pm on Jul 26, 2018 (gmt 0)

10+ Year Member



@Lucy24
https://%{HTTP_HOST}
Don’t do this. Requests for http://example.com will then be sent to https://example.com while requests for http://www.example.com are sent to https://www.example.com and then half of those requests will have to be redirected all over again.


If I add this line would it take care of this?
RewriteCond %{HTTP_HOST} ^mydomain.com$
RewriteCond %{SERVER_PORT} 80


Although I did not do any redirects from non-www to www, most of my traffic goes to www , so I don't worry much about it, but thank you for noting this.

lucy24

6:45 pm on Jul 26, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



There needs to be an [OR] between the two conditions: “If the request is wrong in either of these ways, then redirect.”

And then you make a second rule, using only the HTTPS condition, to grab all other requests.
This 34 message thread spans 2 pages: 34