Rediret https to http

Discussion in 'Installation/Configuration' started by Poliman, Nov 5, 2018.

  1. Poliman

    Poliman Member

    I have subdomain on the server. I need to temporary redirect it from https (which not work currently because of lack of "www" record A and opens first website from the web list) to http. I set:
    Web Domain --> Redirect tab --> R=301,L and inside input Redirect Path - http://sub.domain.pl
    In vhost file I see the lines:
    Code:
                    RewriteEngine on
                    RewriteCond %{REQUEST_URI} ^/\.well-known/acme-challenge/
                    RewriteRule ^ - [END]
                    RewriteCond %{HTTP_HOST}   ^sub\.domain\.pl$ [NC]
    
                    RewriteRule   ^/(.*)$ http://sub.domain.pl  [R=301,L]
    
                    RewriteCond %{HTTP_HOST}   ^www\.sub\.domain\.pl$ [NC]
    
                    RewriteRule   ^/(.*)$ http://sub.domain.pl  [R=301,L]
    
    but this redirection does not work. Still when I enter in browser https://sub.domain.pl I have certificate error.
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Does your browser always use httpS if it is available? Firefox at least has plugin https everywhere that does this.
     
  3. Poliman

    Poliman Member

    Probably always. But this time I haven't installed SSL cert for subdomain and when somebody tries enter this subdomain using https then gets certificate error and yell that cert is issued for website which is on first place on the list in ISP. I will install ssl cert soon but not yet, so if it's possible I need redirect https to http to this specific subdomain. I need to do this for client.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    The SSL connection is established first, so if there is no valid SSL cert for the subdomain, then the redirect will throw an SSL error.
     
  5. Poliman

    Poliman Member

    Yes, there is no ssl cert. Vhost file contains only <virtualhost *:80> part. So it is not possible to do this? Poor me.
    PS
    What if I would create some simple virtualhost *:443 with ServerName, DocumentRoot and redirect from https to http?
     

Share This Page