WordPress Multisite - Alterar site principal de não-www para www

WordPress Multisite - Alterar site principal de não-www para www

Comecei a emitir automaticamente wildcard SSL-Certificatespelo acme-dns-client. Embora tenha uma maneira fácil de cobrir todos os meus subdomínios juntos, estou tendo o problema de não ter cobertura para meu domínio sem www.

Portanto, pensei que poderia ser uma boa ideia apenas change the no-www Mainsitefazer , www.example.netem vez deexample.net


Alguém tem sugestões de como alterar essas configurações, pois elas não estão disponíveis no painel de administração do Wordpress Multisite, aqui você pode apenas alterar os subdomínios para subpáginas.


Eu já tentei apenas adicionar a seguinte linha no arquivo wp-config.php.

define('WP_HOME','https://www.example.net');
define('WP_SITEURL','https://www.example.net');

Mas isso ainda não deu certo. Estou usando o nginx como meu sistema de servidor web raiz.


Configuração Nginx

server {
   location / {
            try_files $uri $uri/ /index.php?$args;
            }

            location ~ \.php$ {
                         include snippets/fastcgi-php.conf;
                         fastcgi_pass unix:/run/php/php7.4-fpm.sock;
             fastcgi_connect_timeout 300s;
                 fastcgi_read_timeout 300s;
                 fastcgi_send_timeout 300s;
            }

            location ~ /\.ht {
                         deny all;
            }

            location = /favicon.ico {
                         log_not_found off;
                         access_log off;
            }

            location = /robots.txt {
                         allow all;
                         log_not_found off;
                         access_log off;
           }

            location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
                         expires max;
                         log_not_found off;
           }

        root /var/www/wordpress;
        index index.php;

        server_name example.net www.example.net get.example.net *.example.net;

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/example.net/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/example.net/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

    #settings for file upload
    client_max_body_size 32M;
}

server {
    if ($host = example.net) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


        listen 80;

        server_name example.net *.example.net;
    return 404; # managed by Certbot


}

informação relacionada