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?



1 Like


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.


1 Like

what if i already create site without www? didn’t work but work just fine… how can i redirect (or update) so user can access both with www and without. ?


I need non-www (naked domain) to forward to www. So to I ran the below command using a sudo user:

sudo ee site create --type=wp --ssl=le --wildcard

I added the txt records and ran sudo ee site ssl once the records propagated. The SSL successfully installed. When I visit I get an SSL error but when I visit everything works great.

I have tried multiple times and when creating the site using www, the non-www doesn’t forward. Any suggestions?


After some digging and testing most of the day I discovered that if you set up EE or create the website with a sudo user, the redirect wont work. You have to create it using root. You also need to have a sudo user created or you cant update or download any plugins.

So for the redirect to work and WP to be able to install/update plugins and themes you need to make sure you have a sudo user setup. Then you need to use root to setup EE and WP.

It does work but it is not the best way to run. Hopefully a update is rolled out soon so that many of these bugs are fixed. I feel like many users are abandoning EE and using other tools.

Any updates in the pipeline?

Thank you

After seeing this . I updated my ee4 and created a website with www. It’s working greatly . I was very happy . But I created another website with www. This one is not working . It’s not going to www. Version of the site . it’s going to 1st website of this server if I type the url without www. Need help . Sorry for bad English

I have this problem too, I have created a website already without a www and at the moment it redirects all www to a non-www address.

Is there a way to change this without having to delete and restore the website?

1 Like

I have same question.

Create a custom config file with the desired redirect in the following directory:


Do not make changes to the default.conf. EE rebuilds this with any changes you do.

1 Like

thanks lotusjeff!

that worked like a charm for me!