Non www SSL site not redirecting to www SSL site

@faizi The question is:

SSL site https://genupdates.com/ is not redirected to https://www.genupdates.com/ ( not working )

but

Non-SSL site http://genupdates.com/ is redirecting to https://www.genupdates.com/ (Working)

What is wrong with https://genupdates.com/ and why it is not redirecting to www

I see.

Try this:

in /etc/nginx/sites-available/ genupdates.com , insert the domain without www

server {

server_name genupdates.com www.genupdates.com;

Thanks but not worked!

server {


server_name genupdates.com;


access_log /var/log/nginx/genupdates.com.access.log rt_cache; 
error_log /var/log/nginx/genupdates.com.error.log;

Reloaded as well as restarted nginx

Put both non-www and www

server {

server_name genupdates.com www.genupdates.com;

:cry: :cry: :cry: No Luck, is there any way to do it with wordpress. I think all server config is good and I have reinstalled site on a new server. All config files are untouched.

or any other way to do it with DNS

Did you create the site with:

ee site create www.genupdates.com

or

ee site create genupdates.com

1 Like

Yes :confused:

ee site create www.genupdates.com --wpfc --letsencrypt

could you try recreate the site with non-www domain,

ee site create genupdates.com --wpfc --letsencrypt

and what are your digital ocean dns entry?

@faizi Hey, I have fixed the problem. I have edited ssl config file and /sites-available/ vhost file

@genupdates mind sharing with us what update you make to the file?

1 Like

Hey @genupdates, Do share your config bro.

Thank you.

1 Like

From your configuration, I can see no issues except what @faizi suggests as an addition. I assume that this issue had to do with the db entries of WP, so sharing your workaround would help others for sure aswell.

In case you have issues in the future, this tool might be a saving one: https://interconnectit.com/products/search-and-replace-for-wordpress-databases/

Its actually a db tool that helps you replace every text instance. It also includes serialized data. Replacing every http:// instance with https:// works like charm and solved strange issues to the WP, in case EE config is just fine, like in your case.

Sorry I was offline

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.