U
U
unlik2019-03-14 21:42:38
Apache HTTP Server
unlik, 2019-03-14 21:42:38

Apache redirect from http to https?

There is a virtual host with the following config
ServerName ...
SSLEngine on
SSLCertificateFile /etc/ssl/100.crt
#SSLCertificateChainFile /etc/ssl/mydomain.ru_ca.crt SSLCertificateKeyFile
/etc/ssl/100.key ServerAdmin
[email protected]
DocumentRoot /var/ www/html
AllowOverride All
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined Using
https, the site opens and works as it should. But at the same time, it also opens with http, although there is no separate config for http. And the htaccess file does not apply to http. What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2019-03-15
@shambler81

it cannot open via http when there is no config for it, on the contrary, it can, but this is the specifics of https.
In your case, if there is no explicit config for the current site, then do not forget that there is also a general default config, perhaps its rules are enough for valid work on http
, so people do not always write https, so blocking a site on http is not correct, in your case it is necessary just redirect to https

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question