HTTP redirect

by mvanduijker



Build Status Coverage Status Deploy

Lots of hosting companies offer a redirect service, which most of the time cost a little bit of money. Now for free if you spin up a free dyno on heroku with this little app.


git clone
npm install


You can configure the following environment variables to setup your redirect:

With REDIRECT_URL you can configure the url where to redirect to (defaults to


With REDIRECT_STATUS_CODE you can configure the desired redirect status code (defaults to 301)


With REDIRECT_KEEP_REQUEST_PATH you can configure if the request path must be stripped of (defaults to false) For example incoming url http://localhost/foo/bar?with=love will be redirected to when turned on and when turned off


Starting that ...

You can run locally with

npm start

Running test suite

npm test

Create coverage report

npm run-script coverage

Shipit on Heroku

Click Deploy to create heroku app. After app has been created, add config variable in the settings tab of your application with REDIRECT_URL and value where you want the app to redirect to. Then configure your custom domains Off you go!