Redirecting from one website to another in dokku

dokku docker

Step 1. Install dokku-redirect plugin
Git: https://github.com/dokku/dokku-redirect

dokku plugin:install https://github.com/dokku/dokku-redirect.git

Step 2. Set the redirect to the new url

dokku redirect:set app-name app-web-url.com app-new-web-url.com

The app-new-web-url can be set to www.app-new-web-url.com
Wasn’t able to use the http/https protocol before the url

Step 3. To redirect individual subdomains, the same procedure needs to be followed for all.
In my case, I also needed to redirect all www.app-web-url.com to www.app-NEW-web-url.com
So,

dokku redirect:set app-name www.app-web-url.com app-new-web-url.com

Step 4. For the above to work, the www.app-web-url.com needs to be set as a domain for the app-name, which can be done by using the dokku’s default domain plugin

dokku domains:set app-name www.app-web.url.com

Step 5. If required to unset, can use

dokku redirect:unset app-name app-web-url.com

Step 6. To check the redirects that has been set.
Could not find a way to see the redirects on all the apps.
To check for the redirects on any single app:

dokku redirect app-name

Leave a Reply

Your email address will not be published. Required fields are marked *