Hello there
Try to follow these steps to switch the country subdomain from using a country name to a country code I hope these will helpful for you
In order to show the new subdomains based on country codes; update your DNS records.
To take into account the new subdomain structure; update the settings on your web server. Changing rewrite rules setups may be necessary for this.
Update the logic to use country codes in place of names if your program requires them for sending .
Verify that your application works as planned and that the new subdomain resolve correctly.