Skip to content

larryfox/rack-domain_director

Repository files navigation

Rack::DomainDirector

Rack middleware for redirecting one domain to another.

Build Status Code Climate

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'

About

Rack middleware to redirect domains

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages