Μετάβαση στο περιεχόμενο

SEO

SEO Improvements - Canonical URL Standardization

This document outlines changes made to standardize canonical URLs across the documentation site, addressing "Alternate page with proper canonical tag" issues reported by Google.

Problem Addressed

Google reported multiple URLs for the same content (e.g., www.e-pragma.gr, docs.e-pragma.gr, e-pragma.gr, and variations with index.html or ?q parameters) leading to indexing inefficiencies due to inconsistent canonical tags.

Solution Implemented

To ensure a single, consistent canonical URL (https://www.e-pragma.gr) for all pages, the following modifications were made:

  1. mkdocs.yml Configuration:

    • Confirmed site_url: "https://www.e-pragma.gr" is correctly set, defining the primary domain for the site.
  2. material/overrides/base.html Modification:

    • The <link rel="canonical"> tag was updated to actively enforce https://www.e-pragma.gr as the canonical domain. This was achieved by modifying the Jinja2 replace filter:
      • http://0.0.0.0:8000/SEO/
    • This ensures that any automatically generated canonical URLs incorrectly containing docs.e-pragma.gr or e-pragma.gr are corrected to www.e-pragma.gr.
  3. sitemap.xml Files Modification (material/overrides/sitemap.xml and docs/sitemap.xml):

    • Both custom sitemap template files were updated with similar replace filters for file.page.canonical_url and file.page.abs_url.
    • This guarantees that all URLs listed within the generated sitemaps also consistently point to https://www.e-pragma.gr, further reinforcing the intended canonical domain for search engines.
Expected Outcome

These changes provide a clear and consistent signal to search engines regarding the preferred version of each page. Over time, this should lead to: * Improved indexing efficiency. * Better search ranking signals consolidated to the canonical https://www.e-pragma.gr URLs. * Reduction in "Alternate page with proper canonical tag" warnings in Google Search Console.

Further Considerations (External to MkDocs Configuration)

While these changes address the canonicalization within the MkDocs build process, persistent issues with index.html suffixes or ?q parameters in Google's reports may require further investigation into: * Web Server Configuration: Ensuring proper 301 redirects are in place for docs.e-pragma.gr and e-pragma.gr to www.e-pragma.gr, and for */index.html to */. * Internal Linking: Reviewing any hardcoded internal links that might still point to non-canonical URLs. * External Backlinks: Identifying and (if possible) updating external backlinks that point to non-canonical URLs.