Most of the pages on my site seem to have indexed just fine. However, when I do an inspection for a certain page on my site, let's say it's http://www.example.com/importantpage.html
, it shows "URL is not on Google". The reason is listed as "Duplicate, Google chose different canonical than user". However, below that it shows
User-declared Canonical:
http://www.example.com/importantpage.html
Google Selected Canonical: N/A
How did "Google choose a different canonical" but the Google Selected canonical is N/A
?
In the head of importantpage.html
I have the following tag defined:
<link rel="canonical" href="http://www.example.com/importantpage.html" />
I also have this entry in the sitemap:
<url>
<loc>http://www.example.com/importantpage.html</loc>
<lastmod>2018-10-01</lastmod>
<priority>1</priority>
</url>
I also have a tag defined:
gtag('config', '<property id>', {
'page_title' : 'importantpage.html',
'page_path': '/importantpage.html'
});
The only thing I can think of that is different for this page is that we have a domain that forwards directly to it (eg, www.1.example
-> www.example.com/importantpage.html
). But since I'm defining the canonical I don't see how this would cause it, but it does seem like a likely culprit. If so, how would I fix it?
Things to note:
- We have no HTTPS
- I am rewriting everything to
www.
in.htaccess
. - We have multiple domains that redirect (301) to
www.example.com
- We have one domain that forwards to
www.example.com/importantpage.html
(as mentioned above)
.htaccess
RewriteEngine on RewriteCond %{HTTP_HOST} ^example.com [NC] RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301,NC]
priority
andlastmod
fields from your sitemap. They only take up space and make you sitemap larger. Google doesn't use them. Google Says They Mostly Ignore the lastmod Tag In XML Sitemaps