Magento 2 header link opens the wrong language. How to check its URL and scope

2 min read

Two silver header links take separate paths to an ivory and an emerald destination

When the German “Versand” shortcut opens a Polish delivery page, check the address rendered in the header, the redirects and the landing page language. Read the value in the Link field separately in the German store view.

Read the link address and configuration scope

In Stores → Configuration → Kowal → Custom Header Links, select the Store View and inspect the Link field in the list. In version 1.0.27, Custom Header Links reads the list in store view scope and renders the stored address as its href. A full URL keeps the specified domain. A path with a single leading slash starts at the current domain’s root. A path without a leading slash depends on the document base URL. If the field inherits its list, check the value in the parent scope as well. Module documentation.

Follow the link to the final page in both views

In a local test of the original block, both links started with the same path despite their different labels. The sample server redirected both clicks to the Polish page. After the DE view URL was changed, the link opened German content with HTTP 200. Repeating the PL test gave the same result as before.

Local test of the delivery information shortcut
Run and viewHeader addressHTTP statusesFinal pathLanguage
Before, PL/dostawa301 → 200/pl/dostawaPL
Before, DE/dostawa301 → 200/pl/dostawaPL
After, DE/de/versand200/de/versandDE

Check addresses after a domain or store code change

Compare the domain and store code with the actual address of the target page. If only one store view needs a different URL, edit the list in that scope and preserve its other rows. Refresh the configuration and page caches after the change. Magento store URL settings.

Open both views in a clean session. In developer tools, enable Preserve log in Network, click the shortcut, and record each status along with the final host, path and content language. Also test from a product page if the link depends on the document’s address. Chrome network tools.

For ordering, icons and link placement, see the earlier header guide.

Previous Next

KOWAL.BLOG

Choose your language

Available versions open the corresponding page. More languages are being prepared.

English (UK) Français Deutsch Español Italiano Português Nederlands Svenska Dansk Norsk Suomi Lietuvių Latviešu Eesti Čeština Slovenčina Magyar Română Български Ελληνικά Slovenščina Hrvatski Polski English (US)