0

When I enter http://ipAddress in the browser's address field, it works. When I enter https://ipAddress it returns NotSecured website. How can I change my configuration so that it generates a 403 error?

<VirtualHost *:443>
ServerAdmin webmaster@localhost
ServerName xxxxxxxxxxx
DocumentRoot /var/www/html/xxxxxxx/public      
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLEngine on
SSLProtocol all -SSLv2 -SSLv3
SSLCertificateFile  /etc/ssl/www_xxxxxx_com_xx.crt
SSLCertificateKeyFile   /etc/ssl/private.key
SSLCertificateChainFile /etc/ssl/www_xxxxxx_com_xx.ca-bundle.crt

<FilesMatch "\.(cgi|shtml|phtml|php)$">
        SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
        SSLOptions +StdEnvVars
</Directory>

       Alias /new /var/www/html/alias2
       <Directory /var/www/html/alias2/>
           Options Indexes FollowSymLinks
           Require all granted
       </Directory>

      Alias /online /var/www/html/alias1
       <Directory /var/www/html/alias1/>
           Options Indexes FollowSymLinks
           Require all granted
       </Directory>

       
       <Directory /var/www/html/main/public/>
           Options Indexes FollowSymLinks
           Require all granted
       </Directory>
      </VirtualHost>

     <VirtualHost *:80>
     ServerName xxxxxxxxxxx
     ServerAdmin webmaster@localhost
     Redirect 403 /
     ErrorLog ${APACHE_LOG_DIR}/error.log
     CustomLog ${APACHE_LOG_DIR}/access.log combined
     </VirtualHost>

    <VirtualHost ipAddress:443>
    ServerName xxxxxxxx
    DocumentRoot /var/www/html/xxxxx/public/
    SSLEngine on
    SSLCertificateFile  /etc/ssl/www_xxxxxx_com_xx.crt
    SSLCertificateKeyFile   /etc/ssl/private.key
    SSLCertificateChainFile /etc/ssl/www_xxxxxx_com_xx.ca-bundle.crt
   </VirtualHost>
berndbausch
  • 1,033
  • 8
  • 12
  • 1
    Nothing is returning a "Not Secured" website, but it's a message shown by your browser. This whole question is based on a misconception. – Esa Jokinen Apr 10 '21 at 12:19
  • This is a duplicate of https://serverfault.com/questions/1059958/how-to-redirect-403-in-apache from the same poster. – berndbausch Apr 11 '21 at 03:38

0 Answers0