Hi @AkshaySwamiii ,
You can try to use externalizer in your custom code to get the URLs with domain. Also, if you have multi territory site then you can include country code in it.
Sample code would look something like this:
@Reference
private Externalizer externalizer;
final String location = this.externalizer.publishLink(
userService.getServiceResolver("<sample-resolver>"),
resource.getPath());
Use com.day.cq.commons.impl.ExternalizerImpl.cfg.json system console configuration define as part of config.publish for having externalizer domain as part of every URL as shown below coming as part of Sitemap. It will be different depend on the run mode or environment.
{
"externalizer.domains": [
"publish https://sampledomain.com"
]
}
-Tarun