WordPress マルチサイト - メインサイトを www なしから www に変更する

WordPress マルチサイト - メインサイトを www なしから www に変更する

wildcard SSL-Certificatesを介して自動発行を開始しましたacme-dns-client。すべてのサブドメインをまとめてカバーする簡単な方法がある一方で、www のないドメインがカバーされないという問題が発生しています。

だから私はchange the no-www Mainsitewww.example.netexample.net


これらの設定を変更する方法についてアドバイスをいただける方はいらっしゃいますか。Wordpress マルチサイト管理ダッシュボードではこれらの設定は利用できないため、ここではサブページのサブドメインを変更することしかできません。


すでに次の行を追加してみましたwp-config.php

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

しかし、これはまだうまくいきませんでした。私はルート Web サーバー システムとして nginx を使用しています。


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


}

関連情報