Remove www to non-www redirect



I have been doing some testing with ee4 for the past couple of weeks and yesterday I moved a live site to my ee4 server. The results have been impressive with almost double page views and a similar increase in ad revenue. Because of this I plan to move my other sites but have one thing I need to fix first.

  1. www to non-www redirect. My sites currently use and I would like to keep this. But when I use “ee site create” everything redirects to I tried using “ee site create” and this worked but when I use the --ssl=le option this only creates a cert for, so if someone visits they get a cert error. When I use the --ssl=le option on the non www domain it creates a cert for both non-www and www domains.

How can I remove the www to non-www redirect and have a non-www to www redirect for my sites? Either in a global config or per site config.




What about creating the --wildcard LE cert?

EE should create the non-www cert though. This appears to be a bug.


I tried the wildcard but couldn’t get it to work. I added both the txt records to my DNS but the SSL auth failed. I have verified that there is no non-www cert created by using


Put Cloudflare in front of it and redirect the non-www to www. That might work for now.


Thanks. I will give that a try



After a bit of playing around, I found a way to get rid of the redirect.

In the /opt/easyengine/services/nginx-proxy/conf.d/ folder you will find a redirect conf file for each site. I simply renamed this (rather than delete it), restarted the site and now I can connect to the www version of the site.

Not sure if this is the ideal way to do it but it seems to have the desired effect. I would like to ask the experts here is doing this is a good or bad idea?





Just a quick update on this if anyone is interested.

creating a site with the www prefix now works. Not sure if there has been an update or just messed up. but the command ee site create --type=wp --cache --with-local-redis --ssl=le

this creates cert for both non and www domain and sets up the non-ww to www redirect.


My website dosen't open when prefix www