Skip to content

Commit

Permalink
add https redirect description.
Browse files Browse the repository at this point in the history
  • Loading branch information
why2pac committed Apr 28, 2018
1 parent ce31cfd commit f94c567
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ $ npm install express-naked-redirect --save
* Redirect **www** request **to** **naked**(root domain, non-www).
* Redirect **naked**(root domain, non-www) request **to** **specific subdomain**.
* Redirect **specific subdomain** request **to** **naked**(root domain, non-www).
* Redirect **http** request **to** **https**(or specific protocol).

## Usage

Expand Down Expand Up @@ -81,6 +82,26 @@ app.use(require('express-naked-redirect')({
}))
```

### Redirect http to https

It allows you to redirect http://domain.tld to https://www.domain.tld

```Javascript
app.use(require('express-naked-redirect')({
subDomain: 'www',
https: true
}))
```

or

```Javascript
app.use(require('express-naked-redirect')({
subDomain: 'www',
protocol: 'https'
}))
```

### Do not redirect specific paths

If you do not want to redirect specific paths, add `except` option. **It requires [`url-pattern`](https://www.npmjs.com/package/url-pattern) library separately.**
Expand Down

0 comments on commit f94c567

Please sign in to comment.