I have the almost same question as this:
But I am confused with the accepted answer, as for my case, the website is hosted using GitHub Pages
and has only one html in root directory: index.html
.
├── assets
├── index.html
├── manifest.json
├── robots.txt
├── sitemap.xml
So, What should be my sitemap.xml
and canonical url
in index.html
?
Should it be like this? sitemap.xml
:
<url>
<loc>https://example.github.io/</loc>
<lastmod>2021-10-19</lastmod>
<priority>1.00</priority>
</url>
and in index.html
<link rel="canonical" href="/"/>
I am very new to this and would appreciate a specific answer to this.
For more info:
Currently my sitemap only contains https://example.github.io/
and no canonical url in index.html
Google Search Console url inspection for https://example.github.io/
says:
Coverage [Indexed, not submitted in sitemap]
Sitemaps: N/A
User-declared canonical: None
Google-selected canonical: Inspected URL
https://example.github.io/
andhttps://example.github.io/index.html
? Which URL do you use to access the page through? Which one do you prefer? The canonical URL is your preferred URL.https://example.github.io/
is my preferred URL. This is the actual URL, I am talking about.