Https redirection

Discussion in 'Installation/Configuration' started by artinfo, Sep 3, 2023.

  1. artinfo

    artinfo Member

    There's a problem since I use ISP with https... What I means is:
    1. I have many pages/clients on my serwer ... some of them use https
    2. If client USE https and I turn of his page ISP redirects to alphabetically FIRST HTTPS page on the list
    client1 (no https)
    client2 (https)
    client n (https) -> if www is disabled and someone tries to get it redirects to
    Any known solution?
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    What you describe is the default behavior of Apache and Nginx web servers, so it's not specific to ISPConfig in any way. If a web server does not find a matching config for a given IP, port, and domain combination, it will use the first config it finds for this IP and port.

    Solutions are:

    a) Turn on SSL for all sites. This should be the norm today anyway, especially as SSL certs via LE are free.
    b) use a different IP address for SSL sites and another one for non-ssl sites.

    Besides the two options above, you should not point subdomains to the server in DNS that are not used, so if someone does not use www subdomain, then do not create a A-Record for the www subdomain that points to your system and in general avoid using wildcard subdomains in DNS for the same reason.
    ahrasis likes this.
  3. artinfo

    artinfo Member

    Thanks... all clear... will do that...
  4. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    you can also enable eg 000-default-ssl vhost, and have that point to a holding page,
    saying eg, the domain requested belongs to one of your clients.., or that site/subdomain is not available via https. even provide a link back to your own company site.

    being the first vhost alphabetically, anyone trying to access a site that doesn't have https, or a subdomain that doesn't exist, they will get your standard holding page instead of another clients site.
    ahrasis likes this.
  5. artinfo

    artinfo Member

    Good idea... will check it.. thnks

Share This Page