I
I
iberk2018-06-08 22:15:29
htaccess
iberk, 2018-06-08 22:15:29

How to make a correct redirect from http to https wildcard subdomains?

I tried a bunch of options and I can’t figure out how to make the right redirect from http to https without www, not only the main domain, but also subdomains.
The following scheme works for the main domain:
RewriteCond %{SERVER_PORT} !^443$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI } [R,L]
but I don't understand how for subdomains(

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