Open wdebusschere opened 3 months ago
Problem: No self-referencing hreflang for urls with query parameters
Example url https://www.domain.be/fr/devis?activity=activity1
If a URL is not a canonical URL - meaning is has parameters and links to a clean URL via link rel="canonical" → do not serve hreflang information.
Hreflang:
<link href="https://www.domain.be/fr/devis" rel="canonical"> <link href="https://www.domain.be/en/quotation" hreflang="en" rel="alternate"> <link href="https://www.domain.be/fr/devis" hreflang="fr" rel="alternate"> <link href="https://www.domain.be/nl/offerte" hreflang="nl" rel="alternate"> <link href="https://www.domain.be/en/quotation" hreflang="x-default" rel="alternate">
Hreflang should be:
<link href="https://www.domain.be/fr/devis" rel="canonical">
Right now i just added this if ($_SERVER['QUERY_STRING'] == "") in the code
($_SERVER['QUERY_STRING'] == "")
Problem: No self-referencing hreflang for urls with query parameters
Example url https://www.domain.be/fr/devis?activity=activity1
If a URL is not a canonical URL - meaning is has parameters and links to a clean URL via link rel="canonical" → do not serve hreflang information.
Hreflang:
Hreflang should be:
Right now i just added this if
($_SERVER['QUERY_STRING'] == "")
in the code