@Younes Dilali Thanks for reaching out to Microsoft Q&A, apologize for any inconvenience caused on this.
Ideally, when you request the custom domain all the requests will be redirected to the default/root of the static website based on the type of domain whether apex or subdomain and also DNS records that you add in the DNS zones of the domain.
Are you adding apex domain or subdomain to the static webapps?
- As mentioned here in this documentation if you are adding subdomain (like www.example.com) then you need to add CNAME record.
- If you are adding Apex domain as custom domain then you need to add CNAME or TXT and ALIAS records in the DNS Zone.
You can also refer to this documentation on how to add the custom domain in static webapps.
Hope this helps let me know if you have any further question on this.