# Missing http redirect for tenants results in 404 error

**Project:** Sites | **Board:** Planned | **Votes:** 3
**URL:** https://roadmap.ploi.io/projects/2-site-level-requests/items/896-missing-http-redirect-for-tenants-results-in-404-error

---

When a certificate is issued for a tenant, the generated file `/etc/nginx/ploi/www.site.com/tenants/www.domain.com-ssl-redirect.conf` only contains a redirect for the tenant's domain from http to https, but not for all domains for which the certificate was issued. This leads to 404 errors if an attempt is made to access a domain via **http** that is not the name of the tenant.

Example/Reproduction:

1. Create a tenant for www.domain.com
2. Customize the tenant's server name so that it listens to www.domain.com and domain.com
3. Issue a certificate for www.domain.com,domain.com.
4. Go to http://domain.com and you will get a 404 error.

Fix:

Instead of using the tenant's domain for the redirect from http to https, all domains of the certificate should be used in `server_name` for the redirect config.

---

## Comments

**Maurice** (2024-02-08T08:08:02+00:00):
[@Dennis](/user/Dennis) The wrong redirect.conf unfortunately also effects certifcate renewals. They fail, if the certificate was issued for more than one domain.

**Alan Mosko** (2024-12-18T20:22:01+00:00):
There should already be this feature for handling tenants with and without www, it's really bad to have to add both for it to work for the client. There could be a parameter to add both or just one of the modes via the API.

