Domain to Custom URL

I have a custom domain forwarded to my fly.io app and I did the whole fly certs add your.example.com and it works fine.

But is it possible for me to forward my domain to a specific url? say, when someone tries to open test.example.com for them to go into myapp.fly.dev/test/dir2/test.html ?

Thank you

Hi,

Not as far as I know :thinking:. There is a way to add custom headers to the response …

… but it doesn’t document setting a code.

I’d assume you have to do that in your app. It should just be a few extra lines. Every language has a way to match a host and/or path and return a response (like a redirect to somewhere else) e.g Node/Express would probably be

app.get('/', function (req, res) { 
    res.redirect('https://www.example.com/example'); 
}); 

i am doing this for uptime kuma.
where do i add this code? and how can i edit my fly.toml since my app is already deployed?

Hi,

Like I say, I don’t think you can do it in fly.toml

So you would need your app/code to do it.

How is impossible to answer - you’d have to look at your app’s code/framework. E.g for Node you might be using Express … so this kind of thing.

But of course if you are using Laravel, Django … etc, each would have their own way to route/redirect.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.