Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
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

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc