How to change non-www to non-www wordpress + nginx + Without killing SEO
-
hello wp friends. I have done a vast and deep search across the internet on how to change my preference from non-www to www in wordpress, from start when I go in general, in the fields:
Settings> generals
WordPress Address (URL): here add www
Site Address (URL): here add wwwAll work with www. Seems job, want finished, but then I see everyone doing it via command line through:
/etc/nginx/sites-available/mydomain.comBut every code they teach breaks the website.
Server {
????Listen 80;
????Server_name example.com;
????Return 301 https://www.example.com$request_uri;
}Server {
????Listen 80;
????Server_name https://www.example.com;
????…
}This quobra,
Server {
????Server_name domain.com;
????Rewrite ^ (. *) https://www.domain.com$1 permanent;
}Server {
????Server_name https://www.domain.com;
????#The rest of your configuration goes here #
}This one also, and several other codes.
And simply, all the codes I’ve got break my website, everyone, I’ve done research all over the world, in several languages, it seems no code works: what should I do to add www on all my websites without harming my SEO?
my life was more easy with apache :'( missed apache. I miss apache :'(??Thanks all.
- The topic ‘How to change non-www to non-www wordpress + nginx + Without killing SEO’ is closed to new replies.