🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

sub-redirect

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sub-redirect

Simple module for redirectfrom subdomain

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

sub-redirect

It's simple express module, for redirect from subdomains.

Usage

  • Installation:
    npm i --save sub-redirect

  • Require:
    var subRedirect = require('sub-redirect');

  • And finally:
    app.use(subRedirect());

Options

The module takes one parameter - an object with options:

app.use(subRedirect({
  code : 301,
  subdomain : "www."
}));
  • code (int): It`s just code response from server.
    Default: 301

  • subdomain (string): Subdomain from which will be redirected. For example:

  app.use(subRedirect({
      subdomain : "mirror."
  }));

And, if you go on address mirror.example.com you will be redirected on example.com.
Default: www.

Keywords

redirect

FAQs

Package last updated on 29 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts