Open Zethson opened 5 years ago
@Imipenem What do you think is the easiest method? Simply redirecting any www request to an https equivalent without www?
Yes, easiest way would be probably to state in the nginx/sites-enabled/igem_tuebingen_website file, that every request for igem-tuebingen.com/www.igem-tuebingen.com should be answered by an https (redirect) request.
`server { if ($host = igem-tuebingen.com) { return 301 https://$host$request_uri; } # managed by Certbot
if ($host = www.igem-tuebingen.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80; server_name www.igem-tuebingen.com igem-tuebingen.com; return 301 https://$host$request_uri; }`
Something like this should do the job.
This might also help with redirecting any traffic to the https version.
This is another issue.
Unfortunately this solely solves https redirecting, but not the issue described above.
https://www.digitalocean.com/community/tutorials/how-to-redirect-www-to-non-www-with-nginx-on-centos-7
Else, users may land in the server config