0

I am currently trying to create my own sitemapprovider. A aspx (ashx?) file that will dynamically create the sitemap file on request.. no static sitemap file. Everything is read from the database.

Why? I have multiple accounts on the same subdomain (with wildcards), and the sitemap file is different for each user. The sitemap file is only used for google and other search engines.

user1.domain.com
user2.domain.com
user3.domain.com
...
user1000.domain.com

all these subdomain share the same files. And if I create a "/web.sitemap" then all share the same sitemap but thats not correct. Beacause all users create their own pages on their homepage. so they need different sitemaps.

So. I want my sitemap to be reachable for all search engines. And I think that the right way is to register the sitemap in web.config. Right? Or is there another way to do it?

the file now is: sitemap.aspx, or sitemap.ashx. (I am not finished)

How do i register my sitemap so all search engines can find it?

Thanks!

Easyrider
  • 3,199
  • 5
  • 22
  • 32
  • 1
    At least for Google, you may want to start at http://support.google.com/webmasters/bin/answer.py?hl=en&answer=156184 Although I'm a little confused by "sitemap file is different for each user. The sitemap file is only used for google..." – MikeSmithDev Jan 04 '13 at 22:57

1 Answers1

1

I present my code to create a dynamic sitemap in the article Dynamic Sitemaps in ASP.NET.

You can either use URL routing to refer to your dynamic sitemap as sitemap.xml, or you could simply submit the real name of your sitemap page to Google and Bing.

But I had a little trouble understanding exactly what you want to do. What do you need the web.config to do exactly? And how would the Google crawler vary this based on user?

Jonathan Wood
  • 65,341
  • 71
  • 269
  • 466
  • That's what i was looking for! Thanks, but one question. i thought that "/web.sitemap" is a file that google search for when they crawl websites, but it is not?? Do I need to submit the url to the sitemap for google, or is there a generic way for search engines to find the sitmap?? – Easyrider Jan 04 '13 at 23:26
  • 1
    It's sitemap.xml, not web.sitemap. You have a couple of choices: A) Submit sitemap.aspx (or whatever) to the search engines as I mentioned, B) Use URL routing to make sitemap.xml point to your sitemap page as I mentioned, or C) Put the URL of your sitemap in your robots.txt file, which is part of the Sitemap protocol I link to from that article. – Jonathan Wood Jan 04 '13 at 23:32
  • BTW, http://www.blackbeltcoder.com/sitemap.xml is implemented this way so that it always includes the latest articles. – Jonathan Wood Jan 04 '13 at 23:42
  • Thanks! One more question. Due to all the different user sub domains. do I need to write the whole url to the sitemap file in robots.txt, or is it enough with "SITEMAP: /sitemap.ashx". (sitemap.ashx returns different content for each sub domain) – Easyrider Jan 04 '13 at 23:49
  • web.sitemap is not used at all for search engines?? – Easyrider Jan 04 '13 at 23:55
  • I'm not sure I understand your first question. This is getting into some of the finer points of sitemaps. Also, this is the first I've heard of web.sitemap. Again, I'd refer you to http://www.sitemaps.org/. And if you find somewhere it talks about web.sitemap, please let me know about it. – Jonathan Wood Jan 05 '13 at 00:25
  • I was wrong about web.sitemap. It is not used for google. I think it is for menus only in .net projects. Thank you for your help Jonathan! – Easyrider Jan 05 '13 at 13:02