Rack::DomainDirector
Rack middleware for redirecting one domain to another.
Usage:
use Rack::DomainDirector,
from: 'example.net', # required
to: 'example.com', # required
status: 302, # optional, default: 301
before_redirect: ->(request) {
# optional, default: no-op
}
Or just TLD's only:
use Rack::DomainDirector,
from: '.net',
to: '.com'
With an Array:
use Rack::DomainDirector,
from: ['.net', '.org'],
to: '.com'