0

i am responsible for my mail server i am new to Debian and mail server aswell i am facing issue after install the ssl certificate the page still shows http:// not https:// i use to see this command root@mail:/# apachectl -S

the output comes like this

*VirtualHost configuration:

*:80                   mail.12345.com (/etc/apache2/sites-enabled/000-default.conf:1)
*:443                  mail.12345.com (/etc/apache2/sites-enabled/000-default.conf:31)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex ssl-stapling: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/var/run/apache2/" mechanism=default
Mutex mpm-accept: using_defaults
Mutex watchdog-callback: using_defaults
Mutex ssl-stapling-refresh: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33
Group: name="www-data" id=33*

enter image description here

my (/etc/apache2/sites-enabled/000-default.conf)

<VirtualHost *:80>
        
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html
        Redirect  / https://webmaster@localhost

    
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

      
</VirtualHost>
<VirtualHost *:443>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html

SSLEngine On
SSLCertificatefile /etc/ssl/1/1.pem
                SSLCertificateChainfile /etc/ssl/1/1.ca-bundle
                SSLCertificatekeyfile /etc/ssl/1/1.key

RewriteEngine On
  RewriteCond %{HTTPS} !=on
  RewriteRule ^/?(.*) https://%{}/$1 [R,L]

</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

why i cant redirect the https page?

Gerald Schneider
  • 23,274
  • 8
  • 57
  • 89
Ana Mal
  • 1
  • 1

1 Answers1

0

RewriteCond %{HTTPS} !=on will match on HTTP-Connections. You have accidentally put the 'HTTP -> HTTPS'-Rule in the HTTPS-Part of the Server. Just move the three Lines in the upper VirtualHost.