# LetsEncrypt working without www, not with www

**URL:** <https://meta.discourse.org/t/letsencrypt-working-without-www-not-with-www/139004>\
**Category:** Product Support\
**Created:** [January 18, 2020, 6:17am UTC](https://meta.discourse.org/t/letsencrypt-working-without-www-not-with-www/139004 "2020-01-18T06:17:47Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Jarland](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jarland/32/166904_2.png) [@Jarland](https://meta.discourse.org/u/Jarland)\
**Post date:** [January 19, 2020, 8:02am UTC](https://meta.discourse.org/t/letsencrypt-working-without-www-not-with-www/139004/7 "2020-01-19T08:02:19Z")

</div>

Easiest fix for someone using their root domain and wanting www to be signed by LE for proper https redirect without overcomplicating it or using another web server to manage the redirect:

Change this:

> issue\_cert() {  
> LE\_WORKING\_DIR=“${LETSENCRYPT\_DIR}” $$ENV\_LETSENCRYPT\_DIR/acme.sh --issue $2 -d $$ENV\_DISCOURSE\_HOSTNAME --keylength $1 -w /var/www/discourse/public  
> }

To this:

> issue\_cert() {  
> LE\_WORKING\_DIR=“${LETSENCRYPT\_DIR}” $$ENV\_LETSENCRYPT\_DIR/acme.sh --issue $2 -d $$ENV\_DISCOURSE\_HOSTNAME -d www.$$ENV\_DISCOURSE\_HOSTNAME --keylength $1 -w /var/www/discourse/public  
> }

In file:  
/var/discourse/templates/web.letsencrypt.ssl.template.yml

Then of course:

> ./var/discourse/launcher rebuild app

---

_[View the full topic](https://meta.discourse.org/t/letsencrypt-working-without-www-not-with-www/139004)._
