Socket
Socket
Sign inDemoInstall

sub-redirect

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    sub-redirect

Simple module for redirectfrom subdomain


Version published
Maintainers
1
Install size
1.73 kB
Created

Readme

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

FAQs

Last updated on 29 Jan 2016

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc