homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / XML Development
Forum Library, Charter, Moderators: httpwebwitch

XML Development Forum

sub-directory pages in sitemap.xml
How to do?

 8:30 am on Mar 19, 2009 (gmt 0)

I'm adding a monthly newsletter to a client's site and created a sub-directory named /directory to keep the pages in.

The hosting company's (apache) server forwards: www.example.com/directory to: directory/example.com

I'm also using a RedirectMatch 301 rule in htaccess to move this directory's pages accordingly. Everything works as expected.

Question: When I add these directory pages to the sitemap.xml...

Do I add them like this:

<url><loc>http://www.example.com/directory</loc>blah... blah...
<url><loc>http://www.example.com/directory/1.html</loc>blah... blah...
<url><loc>http://www.example.com/directory/2.html</loc>blah... blah...

Or like this?

<url><loc>http://directory.example.com</loc>blah... blah...
<url><loc>http://directory.example.com/1.html</loc>blah... blah...
<url><loc>http://directory.example.com/2.html</loc>blah... blah...

Or do I create a new sitemap.xml for just this directory?



 4:15 pm on Mar 19, 2009 (gmt 0)

The authority answer would be:

Cross-site submissions will work only if all sites have been verified in Webmaster Tools, or if your Sitemaps are listed in your robots.txt file.

subdomains are considered "cross-site", as discussed at length here:

if your subdomains are verified as Google suggests, you can put your sitemap XML anywhere you like.
Otherwise, you should put a separate sitemap XML in each subdomain.

I would definitely use the redirected subdomain URLs, since those are the canonical URLs for those pages


 7:15 pm on Mar 19, 2009 (gmt 0)

I didn't say anything about "sub-domains"

This is just a directory (folder), there is only one domain at the account.


 2:26 am on Mar 20, 2009 (gmt 0)

>> [directory.example.com...]

^ that is a subdomain. "example" is the domain, "directory" is the subdomain. "com" is the TLD.


Sorry if I misunderstood your question


 3:57 am on Mar 20, 2009 (gmt 0)

Thanks httpwebwitch. I had too many things going on to thoroughly understand your post (alas tabbed browsing.) Guess I'll make separate sitemap.xml files.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / XML Development
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved