# sub-redirect

> Simple module for redirectfrom subdomain

Latest version **1.0.2** (published 2016-01-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install sub-redirect
pnpm add sub-redirect
yarn add sub-redirect
bun add sub-redirect
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2016-01-29 |
| First published | 2016-01-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Andreev Vladimir |
| Maintainers | andreev.vladimir |
| Keywords | redirect, 301, subdomain, www |

## Links

- npm: https://www.npmjs.com/package/sub-redirect
- Repository: https://github.com/andreevWork/sub-redirect
- Homepage: https://github.com/andreevWork/sub-redirect#readme
- Issues: https://github.com/andreevWork/sub-redirect/issues
- npm.io page: https://npm.io/package/sub-redirect

## Recent versions

- 1.0.2 (latest) — 2016-01-29
- 1.0.1 — 2016-01-29
- 1.0.0 — 2016-01-29

## README

# sub-redirect

It's simple express module, for redirect from subdomains.

## Usage
* **Installation**: <br />
  `npm i --save sub-redirect`

* **Require**: <br />
  `var subRedirect = require('sub-redirect');`

* **And finally**: <br />
  `app.use(subRedirect());`

## Options

The module takes one parameter - an object with options: <br />
<pre>
app.use(subRedirect({
  code : 301,
  subdomain : "www."
}));
</pre>

* **code (int)**:
  It\`s just code response from server. <br />
  Default: `301`

* **subdomain (string)**:
  Subdomain from which will be redirected. For example: <br />
<pre>
  app.use(subRedirect({
      subdomain : "mirror."
  }));
</pre>
  And, if you go on address `mirror.example.com` you will be redirected on `example.com`.<br />
  Default: `www.`

---
_Source: https://npm.io/package/sub-redirect · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
