maybe I misunderstood your question, but this is not something you should be able to do directly from cognito
, the initial "catch-all"
redirection should happen on your site's code.
Once you redirect it to your Cognito hosted UI, which should be a URL similar to this one:
https://{your cognito domain
}/oauth2/authorize?client_id={your client id
}&response_type=code&scope=aws.cognito.signin.user.admin+email+openid+profile&redirect_uri={your site's url
}
Once the auth process is finished it will redirect the user back to you site.I need to point out that first you need to add your site's url in the list of allowed Callback URLs in your app client.
I wish I could be of more help, but how to handle auth on your app is very dependant on the technology you're using, if it helps you this thread discusses how to do this with nuxt and @nuxtjs/auth-next, this will probably give you some more insight into how to approach your problem