Redirect https-www to https-non-www

Discussion in 'Apache' started by raul1ro, Jun 13, 2019.

  1. #3
    I have an file mydom.conf into apache2/sites-available/
    In mydom.conf I have an VirtualHost where is activated SSL and seted reverse proxy to my app from Tomcat.

    
    
    <VirtualHost *:443>
    
       SSLEngine On
    
       SSLCertificateFile /opt/ssl/mydom.crt
       SSLCertificateKeyFile /opt/ssl/mydom.key
       SSLCertificateChainFile /opt/ssl/mydom.ca-bundle
    
       BrowserMatch ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
       SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
    
       ServerName mydom.com
       ServerAlias www.mydom.com
    
       ProxyRequests Off
       ProxyPreserveHost On
       ProxyPass / http://127.0.0.1:8080/myapp-1.0.0/
       ProxyPassReverse / http://127.0.0.1:8080/myapp-1.0.0/
    
    </VirtualHost>
    
    Code (ApacheConf):
    With this VirtualHost, https-mydom.com and https-www.mydom.com show same content.

    What I want is to redirect https-www.mydom.com to https-mydom.com using VirtualHost.
    How I can do that?
     
    raul1ro, Jun 13, 2019 IP
  2. raul1ro

    raul1ro Greenhorn

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #3
    This can be achieved with VirtualHost?
     
    raul1ro, Jun 17, 2019 IP