3

I have a .com website. I have some lamda function on AWS which redirect URL to specific country URL Ex: for India: www.example.com/in for US: www.example.com.us

I have up to 12 geographical regions like the above and also subroutes (ex: www.example.com/profile --> www.example.com/<country code>/profile).

My question is which URLs I need to provide in sitemap.xml for SEO?

I provided without country code but I'm getting Redirect error on Google Search Console.

1 Answer 1

3

For SEO purposes, first make sure that you have implemented hreflang tags correctly on all pages, for all (sub)domains. Here is the documentation:

https://yoast.com/hreflang-ultimate-guide/

Then, serve the sitemap to each country with the URL's that are for that country. Make sure to include the final URL's that people will see in the browser, not the backend URL's that redirect to the final one. Search engines want to crawl the content as the end user will see it.

So basically, your ideal setup should be the following:

  • hreflang tags on all pages of all domians: only one set for everything, as you'll see in the guide
  • an XML sitemap for each domain or subdomain

If for some reason you cannot provide a sitemap for each version of your domain, decide on which one is the default, and serve that.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.