WordPress Multisite – Hauptseite von no-www zu www ändern

WordPress Multisite – Hauptseite von no-www zu www ändern

Ich habe mit der automatischen Ausgabe begonnen . Obwohl ich damit alle meine Subdomains wildcard SSL-Certificatesauf einmal abdecken kann, habe ich das Problem, dass für meine Domain ohne www keinerlei Abdeckung besteht.acme-dns-client

Deshalb dachte ich, es wäre eine gute Idee, einfach zu change the no-www Mainsiteverwenden www.example.net, anstattexample.net


Hat jemand Vorschläge, wie man diese Einstellungen ändert, da sie im Wordpress Multisite Admin Dashboard nicht verfügbar sind. Hier können Sie einfach die Subdomains für Unterseiten ändern.


Ich habe bereits versucht, einfach die folgende Zeile einzufügen wp-config.php.

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

Aber das hat noch nicht geklappt. Ich verwende nginx als mein Root-Webserversystem.


Nginx-Konfiguration

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


}

verwandte Informationen