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?

1 Answer 1

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.

4
  • hi Thanks for your comment still facing the same issue after move to upper side any idea Commented Nov 8, 2021 at 23:54
  • Oh, didn't even think that far :-). a2enmod rewrite Commented Nov 9, 2021 at 0:03
  • After this command restart the apache2 but still i have facing same issue even with new browser Commented Nov 9, 2021 at 0:39
  • any one well known & skilled in apache2 web server, kindly help me out Commented Nov 12, 2021 at 5:06

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.