Nginx redirect from domain.tld to www


I have a WordPress site and I would need to redirect domain.tld to www.domain.tld.

In the Nginx template I have as server_name domain.tld
I tried to add a redirect with return 301 http://www.domain.tld$request_uri; but instead of opening the home page it opens the default “Success your new web server is ready to use”…

Am I missing something?

Make sure you add as alias and then enable redirect function

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.