P
P
pikla2015-08-18 21:45:15
Digital certificates
pikla, 2015-08-18 21:45:15

How to redirect from www to non-www with ssl?

Tell me what to prescribe and where?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex, 2015-08-18
@pikla

Depends on what kind of server you have. Here are the redirects for nginx for example:

// https://www → https://
server {
  listen 443 ssl;
  server_name www.example.ru;

  return 301 https://example.ru$request_uri;
}
// http://www → https://
server {
  listen 80;
  server_name www.example.ru;

  return 301 https://example.ru$request_uri;
}
// http:// → https://
server {
  listen 80;
  server_name example.ru;

  return 301 https://example.ru$request_uri;
}

But it’s very good about setting up HTTPS (adding an SSL certificate and correct security settings).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question