DPDK Architecture  ->  Bootstrap (v3.0.5)

Redirect
>= v2.12.14

Simple redirect middleware for Express

Features

  • Includes the default function with configuration from the application config

Bootstrap

Config

No config implemented

Implementation

const redirect = require('./middleware/redirect');

this.server.use(redirect(this, this.config.redirect));

Usage

Config

{
  "redirect": {
    "enabled": true,
    "debug": false,
    "status": 307,
    "redirectUppercase": true,
    "redirectTrailingSlash": true,
    "redirectDrupalRoutes": false,
    "redirectPrismicRoutes": false,
    "redirects": {
      "static": {},
      "regex": {}
    }
  }
}

Static Redirect

Static redirect example:

{
  "redirects": {
    "static": {
      "/5-sdn-benefits-for-data-centers": "/blog/5-sdn-benefits-for-data-centers",
      "/about/company": "/about",
      "/about/leadership/bill-stein": "/about/leadership/a-william-stein",
      "/about/leadership/joshua-mills/Joshua": "/about/leadership/joshua-mills",
      "/about/leadership/scott": "/about/leadership/scott-peterson",
      "/about/our_leadership": "/about/leadership",
      "/apac-redirect": "https://www.digitalrealty.asia"
    }
  }
}

Regex Redirect

Regex redirect example:

{
  "redirects": {
    "regex": {
      "^/assets/img(.*)": "https://s3-us-west-1.amazonaws.com/production.digitalrealty.craft.public/legacy/img/$1",
      "^/storage/(.*)": "https://s3-us-west-1.amazonaws.com/production.digitalrealty.craft.public/legacy/storage/$1",
      "^/data-centres/?$": "/data-centers",
      "^/data-centres/(.*)": "/data-centers/$1",
      "^/data-centre-(services|solutions).*$": "/data-center-solutions"
    }
  }
}

Links

No links available

Last modifiedMonday, August 2, 2021, 2:25:06 PM UTC
Last authorGlenn de Haan
Commit ID8692065