When an individual node is specified on the "Site information" screen as the default front page, that node should not then also appear separately in the sitemap. Or, if there is a usage case for that behavior that I'm unaware of, there should probably be an option for controlling that behavior. To illustrate, in case my explanation isn't plain to some, if I create node 1 and use it as my site's front page, my sitemap should not contain both http://www.example.com/ and http://www.example.com/node/1, because they are the same page, and most likely I don't want the latter exposed since, if I have Global Redirect installed, you can't navigate to it anyway.

Comments

Anonymous’s picture

Category: bug » feature

Well, the behavior certainly isn't a bug. I can see if Global Redirect is installed that you shouldn't see the specified node URL. I think this comes down to perhaps how `loc` column value is created or perhaps the weight of modules. What weight does the Global Redirect module have in your system as compared to xmlsitemap?

jantoine’s picture

Hi Earnie,

I am having a similar issue with v6.x-1.1. In my system table, the xmlsitemap module has a weight of 5 while the globalredirect module has a weight of 1500. I also have the path_redirect module installed and it has a weight of 0. Thanks for looking into this.

Cheers,

Antoine

Anonymous’s picture

What do you think Dave, "by design"? If Global Redirect is changing the URL after xmlsitemap has stored it there is nothing for xmlsitemap to do. You'll have to modify the module weights for your site so that they best meet desired affects for you. Remember that hooks are called in order by weight and alpha correlation. With the Global Redirect at 1500 and xmlsitemap at 5 the Global Redirect modification to the URL happens too late.

You can check out http://drupal.org/project/util for help with reassigning module weights. I have never used it so don't know if it is the best thing to use.

avpaderno’s picture

There was code in version 6.x-0.x that checked if the node being added was used for the front page (therefore, it was not added).

I think that such checking is computationally expensive, and it should take care of any changes of the front page settings.
In other words, in a site with 10000 nodes, 200 menu links added to the sitemap, and 200 custom links, the check would be done 10400 times. In all those 10400 links added to the sitemap, there can be not more than 3 links that point to the node used for the front page (if a node is used as front page), or 2 links in the case the front page is s custom page created by a third-party module (I am taking the assumption that somebody could have a link to the front page in the menu used by XML Sitemap, or that the URL for the front page would be added to the custom links used by XML sitemap).

Anonymous’s picture

Status: Active » Closed (works as designed)

This is "by design" and "won't fix". I'm allowing "by design" to have greater importance.

avpaderno’s picture

I think that by design is the correct status.

dave reid’s picture

Ideally this would be solved by the "duplicate link checker" (#454442: Disable duplicate links during regeneration) run before generation since it would see that the front page path is the same as a visible sitemap link. The other option would be a checkbox to include or exclude the front page sitemap link, but I'd much rather prefer the generalized solution in the linked issue for duplicate links.

odegard’s picture

Sorry for digging this up again, but I've run into this problem, and it _is_ a problem.

One major purpose of a sitemap.xml is for SEO, and when two links point to the same content, this is an issue.

I also understand that checking the front page settings is computationally expensive, but only if you run the check _while generating_. What if the sitemap was filtered _after_ it was generated?

-Mania-’s picture

I agree it should be fixed. Even Google Webmasters Tools is giving a warning because of it:

"When we tested a sample of URLs from your Sitemap, we found that some URLs redirect to other locations. We recommend that your Sitemap contain URLs that point to the final destination (the redirect target) instead of redirecting to another URL."

The above warning was because node/1 was set as front page but both are found in sitemap.xml.

dave reid’s picture

So you go edit that node, and set its XML sitemap status to be excluded. Done.

-Mania-’s picture

Thanks Dave, that did the trick. I was actually looking for an exclusion list in the XML Sitemap admin settings but didn't think to look in the node itself.

finex’s picture

Issue summary: View changes

Hi, this bug is still present on latest D8/9 version