Angelino Posted October 2, 2023 Posted October 2, 2023 I have multiple language website, the default page is https://double-digit.eu/ and is english but can i force this page to set this with /en for english https://double-digit.eu/en/ ? Because my other language is dutch and there is /nl/ after the URL. Or is this not needed, SEO wise?
flash Posted October 2, 2023 Posted October 2, 2023 I would have bought double-digit.com domain, and then for the dutch double-digit.com/nl. And also doubledigit.com with no hyphens that redirect to double-digit.com for SEO purposes. Or .be double-digit.be if the services and most customers is based in Belgium.
da² Posted October 2, 2023 Posted October 2, 2023 Some answers from Google: https://developers.google.com/search/docs/specialty/international/managing-multi-regional-sites Quote Use different URLs for different language versions Google recommends using different URLs for each language version of a page rather than using cookies or browser settings to adjust the content language on the page. If you use different URLs for different languages, use hreflang annotations to help Google search results link to the correct language version of a page. If you prefer to dynamically change content or reroute the user based on language settings, be aware that Google might not find and crawl all your variations. This is because the Googlebot crawler usually originates from the USA. In addition, the crawler sends HTTP requests without setting Accept-Language in the request header.
flash Posted October 2, 2023 Posted October 2, 2023 In my page i have <!doctype html> <?php $label = 'label'; if ($user->language->name != 'default') { $label = "label{$user->language}";} ?> <html lang='<?=$fields->get('label_languages')->$label;?>'> so when i switch language the language is set to the correct one.
flash Posted October 2, 2023 Posted October 2, 2023 I have also a dropdown switch <?php $homepage = $pages->get( '/' ); $langswitch = ''; foreach ( $languages as $language ) { if ( !$page->viewable( $language ) ) continue; // is page viewable in this language? if ( $language->id == $user->language->id ) { // current user language $langswitch .= "<div class='current'>"; } else { $langswitch .= "<div>"; } $url = $page->localUrl( $language ); $hreflang = $homepage->getLanguageValue( $language, 'name' ); $langswitch .= "<a hreflang='x-default' href='$url' title='{$language->title}'>{$language->title}<div class='{$language->name}'></div></a></div>"; } echo "<div class='dropdown'> <div class='{$user->language->name}' title='Language'></div> <div class='language-switch-ph' style='display:none;'>{$langswitch}</div> </div>"; ?>
wbmnfktr Posted October 2, 2023 Posted October 2, 2023 First: define the matching /name/ for each language in your homepage Second: Go to Modules > Core > Languages Support - Page Names > Settings and define the behaviour This way the homepage will redirect to your specified default language /name/ if set. It won't redirect from /nl/ or /es/ back to the default one. In case you want to switch to another language as the default one - take a look here: Change homepage's default language 5 1
flash Posted October 2, 2023 Posted October 2, 2023 also use rel='alternate' hreflang='<?=$fields->get('label_languages')->$label;?>' for links 1
Angelino Posted October 3, 2023 Author Posted October 3, 2023 @wbmnfktr Thanks, this did it for me. Many thanks i wouldn't have found this. ? 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now