0

I have SSL certificate and I added to my web site and working well but when I access to web site redirect to automatically http. How can I prevent. You can access my apache.conf file to below.

ServerName geoserver.intelliyazilim.com

SSLProxyEngine on
ProxyPreserveHost On
ProxyPass /geoserver http://mydomain:8080/geoserver
ProxyPassReverse /geoserver http://mydomain:8080/geoserver

# Redirect HTTP to HTTPS
<VirtualHost *:80>
    ServerName mydomain
    ServerAlias www.mydomain
    RewriteEngine On
    RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L]
</VirtualHost>

# HTTPS configuration
<VirtualHost _default_:443>
    ServerName mydomain
    ServerAlias www.mydomain

    # SSL/TLS settings
    SSLEngine on
    SSLCertificateFile /home/intelli/Desktop/_.intelliyazilim.com.crt
    SSLCertificateKeyFile /home/intelli/Desktop/KEY.key

    # ProxyPass settings
    ProxyPreserveHost On
    ProxyPass /geoserver https://mydomain:8081/geoserver
    ProxyPassReverse /geoserver https://mydomain:8081/geoserver
</VirtualHost>
Don't Panic
  • 13,965
  • 5
  • 32
  • 51
Arda Peker
  • 39
  • 4
  • Where is your https config? There are so many examples here on SO already, have you checked any of those? Eg: https://stackoverflow.com/questions/16200501/how-to-automatically-redirect-http-to-https-on-apache-servers – Don't Panic Jul 03 '23 at 07:47
  • Unfortunately it is not working. I tried all options. – Arda Peker Jul 04 '23 at 14:08

0 Answers0