troubleshooting Question

Dynamic sitemap creation depending on domain suffix & directing robots.txt

Avatar of Advoco
Advoco asked on
Web Development
4 Comments1 Solution471 ViewsLast Modified:
Hi all.....

I have a hosted site but with two domain names pointing to it with basically the difference being that one is a ".com" and the other a ".ie".

So I'm trying to think of a way to create a sitemap for each domain and have robots.txt point to correct sitemap depending upon which domain was used to access the site: -> robots.txt -> sitemap: -> robots.txt -> sitemap: 

Any ideas?

My current thinking is something like creating the sitemap on the fly when robots.txt directs the crawler: -> robots.txt -> sitemap: -> robots.txt -> sitemap: 

Where sitemapbuilder.php will build the sitemap on demand, putting in the domain suffix as required (".ie" or ".com"). The output of sitemapbuilder.php would then be identical xml to that of a sitemap.xml file.

Would that work? I have no idea tbh. Next question.... if it does work, in Google Webmaster Tools could I just link to the sitemapbuilder.php file or is it strictly a *.xml file?

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros