Additional to the Answers above:
You can refer to the links below for detailed information on IIS HTTP Redirection and Front Door Service in Azure:
How to configure IIS HTTP Redirection in order to access Office 365 Resources via Custom Domain.
Front Door Service: URL redirect.
Here are some other links of discussion on this requirement for your reference:
Internal DNS resolving external URL.
Friendly URLs with Office 365.
If an Answer is helpful, please click "Accept Answer" and upvote it.
**Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread. **