Home With apache2.4, how do I redirect requests for http://www.example.com to https://example.com
Reply: 0

With apache2.4, how do I redirect requests for http://www.example.com to https://example.com

user721
1#
user721 Published in May 21, 2018, 5:00 pm

I installed an SSL cert from LetsEncrypt on my apache2.4 vhost.

Now, requests for http://example.com go to https://example.com.

However, some browsers will not redirect http://www.example.com to https://example.com. Instead, they redirect https://www.example.com, and show a full-page security warning.

Presently, the rewrite rules in my config look like this:

RewriteCond %{SERVER_NAME} =example.com [OR]
RewriteCond %{SERVER_NAME} =www.example.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]

How do I adjust the rules so that for all browsers, requests for http://www.example.com go to https://example.com?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.320292 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO