nginx redirection

 server {

    listen 80;
    listen 443 ssl;

    server_name domain.tld www.domain.tld;

    # global HTTP handler
    if ($scheme = http) {
        return 301 https://www.domain.tld$request_uri;
    }

    # global non-WWW HTTPS handler
    if ($http_host = domain.tld){
        return 303 https://www.domain.tld$request_uri;
    }
}

Redirect www to non-www

 return 301 $scheme://driesdeboosere.dev$request_uri;

Comments

Popular posts from this blog

how to install internet download manger in linux

ImportError: DLL load failed while importing onnx_cpp2py_export

cpanel exam CPSP Answers