---
title: Rewrites and SSL
summary: Enable clean URLs and local HTTPS on your embedded server.
icon: phosphor-duotone:lock
tags: [course]
---

Most frameworks want clean URLs, and many features need HTTPS even in development. In this lesson you will turn on both in your `server.json`.

## URL rewrites

With rewrites on, a URL like `/index.cfm/main` can simply be `/main`.

```bash
box server set web.rewrites.enable=true
```

Or for a single start:

```bash
box server start --rewritesEnable
```

If your web root has an `index.bxm`, requests are rewritten to that file. Otherwise they go to `index.cfm`. Use the `rewritesFile` argument to name a different front controller.

## Local HTTPS

Turn on SSL and pick a port.

```json title="server.json"
{
    "web": {
        "http": {
            "port": 8080
        },
        "ssl": {
            "enable": true,
            "port": 8443
        },
        "rewrites": {
            "enable": true
        }
    }
}
```

```bash
box server restart
```

Browse to `https://127.0.0.1:8443`. Without a certificate of your own the browser will warn that the connection is not trusted, which is fine for local work.

To use a real certificate, point at your files.

```bash
box server set web.ssl.certFile=/path/to/dev.crt
box server set web.ssl.keyFile=/path/to/dev.key
```

!!! info "CommandBox Pro"
    Multi-site SSL management is a CommandBox Pro feature, along with multi-site management and deployment, the OS service manager and server config sync with ForgeBox. Pro is included with BoxLang Essentials, BoxLang+ and BoxLang++ plans. See [boxlang.io/plans](https://boxlang.io/plans).

## Recap

- `web.rewrites.enable` gives you clean URLs for your front controller.
- `web.ssl.enable` and `web.ssl.port` add an HTTPS listener.
- Set `web.ssl.certFile` and `web.ssl.keyFile` to use your own certificate.
