Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Canonical Tour #388

Open
martinheppner opened this issue Jul 23, 2024 · 1 comment
Open

Canonical Tour #388

martinheppner opened this issue Jul 23, 2024 · 1 comment
Assignees

Comments

@martinheppner
Copy link
Contributor

martinheppner commented Jul 23, 2024

Every tour detail page (like https://www.zuugle.at/tour/462/wien) needs in the header a line like this:

<link rel="canonical" href="https://www.zuugle.at/tour/462/" hreflang="de-at"/>
<link rel="alternate" href="https://www.zuugle.si/tour/462/" hreflang="sl-si"/>

The correct URL is determined by this sql, which has to be implemented on the backend.

SELECT
tour_id,
city_slug,
url,
CASE WHEN ranking=1 THEN 'canonical' ELSE 'alternate' END AS canonical,
hreflang,
source_url
FROM (
	SELECT 
	RANK() OVER(PARTITION BY c2t.tour_id ORDER BY c2t.min_connection_no_of_transfers ASC, c2t.min_connection_duration ASC, c2t.stop_selector DESC, c2t.city_slug ASC) AS ranking,
	c2t.tour_id,
	c2t.city_slug,
	CONCAT('www.zuugle.', LOWER(c2t.reachable_from_country), '/tour/', c2t.tour_id, '/', c2t.city_slug) AS url,
	CASE WHEN c2t.reachable_from_country='SI' THEN 'sl-si' 
		  WHEN c2t.reachable_from_country='DE' THEN 'de-de'
		  WHEN c2t.reachable_from_country='IT' THEN 'it-it'
		  WHEN c2t.reachable_from_country='CH' THEN 'de-ch'
		  WHEN c2t.reachable_from_country='LI' THEN 'de-li'
		  WHEN c2t.reachable_from_country='FR' THEN 'fr-fr'
		  ELSE 'de-at' END AS hreflang,
	t.url AS source_url	
	FROM city2tour AS c2t
	INNER JOIN tour AS t
	ON t.id=c2t.tour_id
	WHERE c2t.tour_id=${id}
) AS a
ORDER BY 1 ASC, 4 DESC, city_slug ASC
@martinheppner martinheppner converted this from a draft issue Jul 23, 2024
@martinheppner
Copy link
Contributor Author

E-Mail von Google dazu:

Image

@martinheppner martinheppner self-assigned this Aug 31, 2024
@martinheppner martinheppner moved this from Todo to In Progress in Zuugle Aug 31, 2024
@github-project-automation github-project-automation bot moved this from In Progress to In review in Zuugle Sep 1, 2024
@martinheppner martinheppner reopened this Sep 1, 2024
@github-project-automation github-project-automation bot moved this from In review to In Progress in Zuugle Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

No branches or pull requests

1 participant