dadi / web

Web is a drop in front end for websites and web apps. Consumes data from DADI API and others
https://dadi.cloud/en/web/
Other
48 stars 16 forks source link

Extend domain redirects #487

Closed jimlambie closed 5 years ago

jimlambie commented 5 years ago

This PR modifies the way we do a domain redirect. The existing functionality is to supply only a hostname to redirect to, as a String property. The change requires configuring forceDomain to be an object containing hostname, port and redirect type (now also a number rather than a string).

The default is an empty hostname, effectively disabling the functionality.

 default: {
        hostname: '',
        port: 80,
        type: 301
      }

Example

To redirect to example.com from www.example.com temporarily you could configure it thus:

"rewrites": {
  "forceDomain": {
    "hostname": "example.com",
    "type": 307
  }
}

Close #271