Non www SSL site not redirecting to www SSL site

I edited my /etc/nginx/conf.d/force-ssl-genupdates.com.conf file and below is my configuration:

server { server_name genupdates.com; rewrite ^(.*) https://www.genupdates.com$1 permanent; } server { listen 80 default_server; listen [::]:80 default_server; server_name genupdates.com; return 301 $scheme://www.genupdates.com$request_uri; }

Thank you

1 Like

Great, Thanks for sharing.

From my experience, its not really advised to edit force-ssl-genupdates.com.conf or even /etc/nginx/sites-available/genupdates.com file. If possible, you can include a custom.conf file inside a directory that its config files are included in the configuration. This way, you will prevent these changes from being overwritten (update or related) - which has a small chance to occur, however, its still a chance.

Hi @genupdates,
Thanks for the update.

I checked your site, and as @ggloveswp pointed out, there are few issues with your configuration.

When I checked your site on a clean browser, typing www.genupdates.com or http://www.genupdates.com gives redirect error,

Though https version ( both non-www and www) is working well, but during my check, non-www was not redirecting to www . and hence there were two instances of site 1. https://www.genupdates.com and other 2. https://genupdates.com and it’s bad for SEO.

Hope you will figure it out soon.

Thank you.

Well, checked it again, Apparently, you have fixed all the issue :slight_smile:

Everything now redirects to https://www.genupdates.com/ , which is great but https://genupdates.com/ still opens as it is… hence from Search engine perspective, you still need to work on it.

I am planning to do same thing on a multisite environment and @ggloveswp is helping me with this here- Non-www to www redirect on Multisite created using EasyEngine , if you can give some insights on this as well, it will be great.

Thanks.