By EPfeiffer
Okay so the site was redirecting www to be non-www. But since there are quite a few backlinks that where www. Need to change the WordPress site so that it is www. Currently it is non-www. The issue was when changing the site config file for Ngnix.
server {
listen 80;
server_name localhost 999.999.99.99 www.domain.com domain.com;
root /var/www/domain.com/web;
if ($http_host != "www.domain.com") {
rewrite ^ http://www.domain.com$request_uri permanent;
}
Then restart Ngnix, that part works fine. But when updating the site URL and home URL to be both www in the WordPress options db table. I can not log into the dashboard site.
I know I will need to run a site update so that all links are www from non-www. https://wordpress.org/plugins/velvet-blues-update-urls/
Any help would be appreciated.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Simplest solution is to create two “servers” one for non-www and one for www. In the non-www enter this config:
listen 80;
server_name example.com;
return 301 http://www.example.com$request_uri;
and on the www just your original config, but server_name with only www.example.com.
Just for info: return 301 [url] means that you permanently redirect client to the url.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.