skip to Main Content

i use aws ec2 bitnami wordpress built a webiste. but i face one issue.
for installing SSL, I Changed .conf document. now I faced one problem.
i can open the domain abc.com (for example only) but can not open www.abc.com.when i want to open www..abc.com , it redirect the address to http://abc.comhttps//www.abc.com/.
May i now how to solve it?
https://snipboard.io/3F7IqY.jpg

2

Answers


  1. Chosen as BEST ANSWER

    I not sure how edit .conf here, can I add the conf code here for checking?

    # Default Virtual Host configuration.
    
    <IfVersion < 2.3 >
      NameVirtualHost *:80
      NameVirtualHost *:443
    </IfVersion>
    
    <VirtualHost _default_:80>
      DocumentRoot "/opt/bitnami/apache2/htdocs"
    RewriteEngine On
    RewriteCond %{HTTP:X-Forwarded-Proto} !https
    RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI}
    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^panasonicservomotor.com$
    RewriteCond %{HTTP_HOST} !^(localhost|127.0.0.1)
    RewriteRule ^(.*)$ http://panasonicservomotor.com$1 [R=permanent,L]
      <Directory "/opt/bitnami/apache2/htdocs">
        Options Indexes FollowSymLinks
        AllowOverride All
        <IfVersion < 2.3 >
          Order allow,deny                          
          Allow from all
        </IfVersion>
        <IfVersion >= 2.3 >
          Require all granted
        </IfVersion>
      </Directory>
    
      # Error Documents
      ErrorDocument 503 /503.html
    
      # Bitnami applications installed with a prefix URL (default)
      Include "/opt/bitnami/apache2/conf/bitnami/bitnami-apps-prefix.conf"
    </VirtualHost>
    
    # Default SSL Virtual Host configuration.
    
    <IfModule !ssl_module>
      LoadModule ssl_module modules/mod_ssl.so
    </IfModule>
    
    Listen 443
    SSLProtocol all -SSLv2 -SSLv3
    SSLHonorCipherOrder on
    SSLCipherSuite "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS !EDH !RC4"
    SSLPassPhraseDialog  builtin
    SSLSessionCache "shmcb:/opt/bitnami/apache2/logs/ssl_scache(512000)"
    SSLSessionCacheTimeout  300
    
    <VirtualHost _default_:443>
      DocumentRoot "/opt/bitnami/apache2/htdocs"
    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^panasonicservomotor.com$
    RewriteCond %{HTTP_HOST} !^(localhost|127.0.0.1)
    RewriteRule ^(.*)$ https://panasonicservomotor.com$1 [R=permanent,L]
      SSLEngine on
    SSLCertificateFile "/opt/bitnami/apache2/conf/server.crt"
    SSLCertificateKeyFile "/opt/bitnami/apache2/conf/server.key"
                
      <Directory "/opt/bitnami/apache2/htdocs">
        Options Indexes FollowSymLinks
        AllowOverride All
        <IfVersion < 2.3 >
          Order allow,deny                          
          Allow from all
        </IfVersion>
        <IfVersion >= 2.3 >
          Require all granted
        </IfVersion>
      </Directory>
    
      # Error Documents
      ErrorDocument 503 /503.html
            
      # Bitnami applications installed with a prefix URL (default)
      Include "/opt/bitnami/apache2/conf/bitnami/bitnami-apps-prefix.conf"
    </VirtualHost>
    
    # Bitnami applications that uses virtual host configuration
    Include "/opt/bitnami/apache2/conf/bitnami/bitnami-apps-vhosts.conf"


  2. Bitnami Engineer here,

    Please follow these steps to force the redirection to HTTPS in our stack:

    • Add the following lines in the default Apache virtual host configuration file at /opt/bitnami/apache2/conf/bitnami/bitnami.conf, inside the default VirtualHost directive, so that it looks like this:
    <VirtualHost _default_:80>
      DocumentRoot "/opt/bitnami/apache2/htdocs"
      RewriteEngine On
      RewriteCond %{HTTPS} !=on
      RewriteCond %{HTTP_HOST} !^(localhost|127.0.0.1)
      RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [R,L]
      ...
    </VirtualHost>
    
    • Restart Apache to apply the changes.
    sudo /opt/bitnami/ctlscript.sh restart apache
    

    You can find more information about this redirection in our documentation

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search