2

I am using Google Webmaster Tools for my web site.

There are multiple users in my website and they dynamically create pages like the following and many more combinations.

  • /site1/Home
  • /site1/Topic/Details
  • /site1/page2
  • /site2/Home
  • /site2/Custompage
  • /site4/Login
  • /site100/Register
  • /site20/Home

How I can create a sitemap with all these dynamic URLs and submit it to Google Webmaster Tools?

1

First, we have to assume that all of your users want all of their files to be indexed by search engines.

Second, we need a method to get the sitemap to Google. Especially in your case, the easiest way is to use robots.txt.

Sitemap: http://www.example.com/sitemap.xml

Third, you need a sitemap. If you don't already have a way to generate a sitemap for all of your users, then just remember that a sitemap is merely a list of files in a special format. Use some simple scripting to list all of the files on the server in the proper XML format, then set the script as a chron job to run every day or week or how often you think it needs to run.

1

Could each of your users maintain their own sitemap?

If so, you could use a sitemap index. Its intended use is for when your sitemap is too big, I believe, but you could as well list all the sitemaps you expect your users to create.

<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
   <sitemap>
   <loc>http://www.example.com/site1/sitemap.xml.gz</loc>
      <lastmod>2004-10-01T18:23:17+00:00</lastmod>
   </sitemap>

   <sitemap>
      <loc>http://www.example.com/site2/sitemap.xml.gz</loc>
      <lastmod>2005-01-01</lastmod>
   </sitemap>

</sitemapindex>

Another option is to do as Google does, and include a list of sitemaps in your robots.txt file.

Sitemap: https://www.google.com/edu/sitemap.xml
Sitemap: https://www.google.com/work/sitemap.xml
Sitemap: https://www.google.com/intx/sitemap.xml

In your case

Sitemap: https://example.com/site1/sitemap.xml
Sitemap: https://example.com/site2/sitemap.xml
Sitemap: https://example.com/site100/sitemap.xml

Again, each user would need to maintain a sitemap and I don't know how well or widely either of those solutions is supported.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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