Website URL Canonicalisation: An Essential Part of On-Page SEO Optimisation
Last Updated:
Website URL canonicalisation is a crucial aspect of on-page SEO optimisation. When a search engine indexes a website, it must choose the best URL to represent that domain. A website can typically be accessed from several different URLs, all pointing to the same domain. For example:
https://domain.com
https://domain.com/
https://domain.com/index.html
https://www.domain.com
https://www.domain.com/
https://www.domain.com/index.html
All the above URLs will lead to the same page. Internal links on your website to your homepage and other internal pages should be consistent. You need to decide which URL variation you want search engines to index to streamline their process. If you are inconsistent with links to your homepage, or if other websites link to you with different URL versions, multiple versions can get indexed. This means that not all the ranking power is focused in one place; it is essentially split.
How Can I Fix My Website’s URLs?
Inform Google
To communicate your preferred URL structure to Google, use Google Search Console. Although Google Search Console does not allow you to set canonical URLs directly, it provides several tools and insights to help with canonicalisation:
- Monitoring Canonical Tags:
- Reporting: Google Search Console shows how Google interprets and indexes your URLs. By checking the Coverage and Enhancements reports, you can see which pages Google considers canonical.
- Inspecting URLs: The URL Inspection Tool lets you check individual pages to see which URL Google has indexed as the canonical version. This helps identify discrepancies between your intended canonical URLs and Google’s selection.
- Identifying Indexing Issues:
- Coverage Reports: These reports highlight issues such as duplicate content, non-indexable pages, or other indexing problems. They show which URLs Google is crawling and indexing, allowing you to identify where canonical tags may need adjustment.
- Duplicate Content Detection: Google Search Console can alert you to duplicate content issues, which often necessitate canonicalisation to consolidate indexing signals.
- Requesting Crawls:
- Crawl Request: After making changes to your canonical tags or URL structure, you can request a recrawl of affected pages through the URL Inspection Tool. This helps speed up the re-indexing process for your preferred URLs.
- Sitemap Submission:
- Sitemap Management: Ensure your XML sitemap lists the preferred canonical URLs. Submitting this sitemap through Search Console helps Google discover and prioritise the correct versions of your pages for indexing.
- Enhancing Understanding with Data:
- Performance Data: Analyse how different URLs perform in search results using the Performance Report. This can help you understand which pages may need canonicalisation to improve their visibility and click-through rates.
- International Targeting:
- Hreflang Management: For sites with international versions, use the International Targeting report to manage hreflang tags effectively. This helps ensure the correct regional or language version of a page is shown to users and indexed by Google.
Implementation Steps:
- Use Proper Canonical Tags: Add
<link rel="canonical" href="http://www.domain.com/page"/>
to the<head>
of your pages. - Check Coverage Reports: Regularly review these reports to ensure that the intended canonical URLs are being indexed.
- Fix Issues Promptly: Address any identified errors or warnings related to duplicate content or crawling issues.
- Use URL Inspection: Regularly use this tool to verify that the correct canonical versions of your pages are being recognised by Google.
- Submit a Clean Sitemap: Include only canonical URLs in your sitemap and submit it through Google Search Console to help guide Google’s crawling and indexing.
Using a .htaccess File for URL Canonicalisation
You can use an .htaccess
file to redirect all variations of URLs to your preferred version, ensuring that all incoming traffic focuses on a single URL. This helps consolidate ranking power and provides consistency across the web.
Here are some common .htaccess rules (these may need adjusting depending on your hosting setup):
To Always Include the www:
RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.domain\.com [NC] RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]
To Redirect /index.html to /
RewriteCond %{REQUEST_URI} /index\.html?$ [NC] RewriteRule ^(.*)index\.html?$ /$1 [R=301,L]
To Always Include the Trailing Slash:
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*[^/])$ http://www.domain.com/$1/ [L,R=301]
Additional Best Practices
- Use Canonical Tags: As mentioned, always include a canonical tag in the HTML
<head>
of your pages to guide search engines to the correct URL version. - Internal Linking: Ensure all internal links use the preferred URL version.
- Consistent Sitemap: Ensure your XML sitemap contains the preferred URL versions.
- Check Backlinks: Reach out to websites that link to your site and ask them to update their links to your preferred URL version.
Conclusion
By standardising your URLs and using tools like Google Search Console along with .htaccess
file adjustments, you can improve your site’s SEO performance and ensure search engines index your preferred URLs. This consistency helps maximise your site’s ranking potential by consolidating the ranking signals into a single URL version.