27/5000 HTTPS to another domain

Discussion in 'ISPConfig 3 Priority Support' started by misterm, Feb 10, 2017.

  1. misterm

    misterm Member

    My question is probably and painfully difficult to understand, but under NGINX, I would like to know if you can create 301 redirects in https to another domain without the ssl?
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    It does not matter for a 301 redirect if the target domain uses http or https, you can specify that in the URL of the target in the rewrite rule.


    rewrite ^/directory/(.*)$ http://newdomain.tld/$1 permanent;
  3. misterm

    misterm Member

  4. till

    till Super Moderator Staff Member ISPConfig Developer

    The first path is the source (old), so it's a path of the local site where you add the rule in and not the new domain. So using https:// in the first part will not work. But if you have several domains pointing to this website and the rewrite shall happen only for one specific domain, then you can e.g. limit the rewrite to that domain by using an if statement: http://nginx.org/en/docs/http/ngx_http_rewrite_module.html#if

Share This Page