Nginx Directives to redirect *.domain.co to domain.co

Discussion in 'Server Operation' started by intrinsic, Aug 25, 2021 at 9:03 AM.

  1. intrinsic

    intrinsic New Member

    Hello! Almost have the server perfectly configured but can't figure this one out.

    I'm trying to have the directives or vhost configuration to redirect misspelled subdomains to the main domain, e.g. xyz.domain.com to redirect to domain.com.

    However the misspelled domains instead give a https error page instead of redirecting. I do not have a wildcard SSL cert and it's currently using the built-in SSL feature. I've searched thoroughly, but cannot find the solution despite using many different tutorials.

    Under sites I have the following config:
    IPv4-Address: *
    Domain: domain.com
    Dependent sub- / aliasdomains: *.domain.com
    Auto-Subdomain: *.
    SSL: Checked
    Let's Encrypt SSL: Checked
    PHP: PHP-FPM

    Redirect
    Redirect Type: No flag
    Redirect Path: Blank
    SEO Redirect: *.domain.tdl => domain.tdl
    Rewrite Rules: Blank
    Rewrite HTTP to HTTPS: Checked

    Any help in solving this would be super appreciated!
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    There is no solution except getting a wildcard SSL cert in my opinion. A redirect always happens after SSL connect, so if SSL connect fails or requires to accept a wrong SSL cert, then you don't get redirected.
     

Share This Page