Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 2 replies, has 2 voices.

Last updated by Bobby 1 month, 2 weeks ago.

Assigned support staff: Bobby.

Author Posts
January 8, 2021 at 5:27 am #7798783

elaineS-4

Tell us what you are trying to do?
I want the main site URL to display the site title and excerpt in the main language

Is there any documentation that you are following?
I followed some threads on your documentation and created a lang.php page with the following code:

<?php

header( 'Location: <u>hidden link</u>' ) ;

?>
<?php

if(substr( $_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2 ) == 'es' ) {
header( 'Location: hidden link' );
}else if( substr( $_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2 ) == 'en' ) {
header( 'Location: hidden link' );
}

?>

Is there a similar example that we can see?
SpintoTalent.com was build as a copy of Spinto.com.mx (this one works correctly)
Suddenly the site stopped working the same way Spinto.com.mx was
I uploaded the sample of how the url share looks on social media

What is the link to your site?
hidden link

Screen Shot 2021-01-07 at 11.57.35 PM.png
Screen Shot 2021-01-07 at 11.59.48 PM.png
January 10, 2021 at 11:56 pm #7811105

elaineS-4

I made some changes to the php document. I can now see a page title when I share on social media. Although GT Metrix marks delays on redirects.
I there a more efficient way to do this?

<?php

header( 'Location: hidden link' ) ;

?>
<?php

if(substr( $_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2 ) == 'es' ) {
header( 'Location: hidden link' );
}else if( substr( $_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2 ) == 'en' ) {
header( 'Location: hidden link' );
}

?>

ont.net/production/logos/preview_matecat.png","project_details_url":"hidden link","add_language_pair_url":"","custom_text_url":"","select_translator_iframe_url":"","translator_contact_iframe_url":"","quote_iframe_url":"","has_translator_selection":false,"project_name_length":128,"suid":"8cce487cb1cb5f6c7643235e2da82fa4","doc_url":"https://wpml.org/translation-service/matecat/","notification":false,"tms":true,"has_language_pairs":false,"deadline":false,"oauth":false,"oauth_url":"","popup_message":"","how_to_get_credentials_desc":"A member of the MateCat team will email you an API Key and API Secret Key","how_to_get_credentials_url":"https://wpml.org/translation-service/matecat/#receiving-api-keys","client_create_account_page_url":"https://wpml.org/translation-service/matecat/#requesting-an-account","partner":false,"review_url":null,"uses_ate":false,"custom_fields":[{"label":"API Key","name":"api_key","type":"text"},{"label":"API Secret","name":"api_secret","type":"text"}],"default_service":0,"translation_feedback":true,"feedback_forward_method":"manual","rankings":{"quality":0,"quality_ranking":0.0,"speed":0,"speed_ranking":0.0,"popularity":0,"popularity_ranking":0.0,"primary":0,"primary_ranking":0.0},"specializations":[],"countries":[],"certifications":[],"redirect_to_ts?":true},{"id":22,"name":"SDL Language Cloud","description":"SDL Language Cloud has been translating content for small to medium-size businesses for more than 25 years. It employs 15,000 in-territory translators which specialize in automotive, banking and e-commerce among other industries.","url":"hidden link","logo_url":"hidden link","logo_preview_url":"hidden link","project_details_url":"hidden link","add_language_pair_url":"","custom_text_url":"","select_translator_iframe_url":"","translator_contact_iframe_url":"","quote_iframe_url":"","has_translator_selection":false,"project_name_length":128,"suid":"e050f3d3a0bfccd551c2286233d60837","doc_url":"https://wpml.org/translation-service/sdl-language-cloud/","notification":true,"tms":false,"has_language_pairs":true,"deadline":true,"oauth":false,"oauth_url":"","popup_message":"","how_to_get_credentials_desc":"Your username and password are the same as the credentials you use to login to SDL Language Cloud","how_to_get_credentials_url":"https://wpml.org/translation-service/sdl-language-cloud/#connecting-to-language-cloud","client_create_account_page_url":"hidden link","partner":false,"review_url":null,"uses_ate":false,"custom_fields":[{"label":"Username","name":"username","type":"text"},{"label":"Password","name":"password","type":"text"}],"default_service":0,"translation_feedback":true,"feedback_forward_method":"manual","rankings":{"quality":0,"quality_ranking":0.0,"speed":2,"speed_ranking":4953.0,"popularity":2,"popularity_ranking":15.38,"primary":2,"primary_ranking":15.38},"specializations":[],"countries":[],"certifications":[],"redirect_to_ts?":true},{"id":8,"name":"Gengo","description":"Gengo’s people-powered translation platform helps you translate content into over 36 languages through a selective, global network of translators.","url":"hidden link","logo_url":"hidden link","logo_preview_url":"hidden link","project_details_url":"hidden link","add_language_pair_url":"","custom_text_url":"","select_translator_iframe_url":"","translator_contact_iframe_url":"","quote_iframe_url":"","has_translator_selection":false,"project_name_length":128,"suid":"63f155572eb659a462aac247ee1bbf8d","doc_url":"https://wpml.org/translation-service/gengo/","notification":true,"tms":false,"has_language_pairs":true,"deadline":false,"oauth":false,"oauth_url":"","popup_message":"","how_to_get_credentials_desc":"Your public and secret keys are found on your Gengo Customer Dashboard","how_to_get_credentials_url":"https://wpml.org/translation-service/gengo/#generate-api-keys","client_create_account_page_url":"https://wpml.org/translation-service/gengo/#create-gengo-account","partner":false,"review_url":"https://wpml.org/submit-your-review/?parent_translation-service_id=805025","uses_ate":false,"custom_fields":[{"label":"Public key","name":"public_key","type":"text"},{"label":"Private key","name":"private_key","type":"text"}],"default_service":0,"translation_feedback":true,"feedback_forward_method":"email","rankings":{"quality":0,"quality_ranking":0.0,"speed":3,"speed_ranking":5283.0,"popularity":2,"popularity_ranking":11.88,"primary":2,"primary_ranking":11.88},"specializations":[{"name":"Business","key":"business"},{"name":"e-Commerce","key":"e-commerce"},{"name":"Tourism \u0026 Travel","key":"tourism_travel"}],"countries":[{"name":"Japan","code":"JP"},{"name":"Philippines","code":"PH"},{"name":"United States","code":"US"}],"certifications":[],"redirect_to_ts?":true},{"id":12,"name":"OneHourTranslation","description":"OneHourTranslation provides translations in more than 75 languages and 2500 languages pairs for medium to large businesses. It specializes in providing business translations in a variety of fields including legal, technical and web applications.","url":"hidden link","logo_url":"hidden link","logo_preview_url":"hidden link","project_details_url":"hidden link","add_language_pair_url":"","custom_text_url":"","select_translator_iframe_url":"","translator_contact_iframe_url":"","quote_iframe_url":"","has_translator_selection":false,"project_name_length":128,"suid":"8850fd4bfdaae2a2d63e51fb1f2ac3e4","doc_url":"https://wpml.org/translation-service/onehourtranslation/","notification":true,"tms":false,"has_language_pairs":true,"deadline":true,"oauth":false,"oauth_url":"","popup_message":"\u003ca href=\"hidden link\" target=\"_blank\"\u003eRegister\u003c/a\u003e to OneHourTranslation to receive your API token.\u003cbr /\u003eAlready have an account? Log-in and \u003ca href=\"hidden link\" target=\"_blank\"\u003eget your token\u003c/a\u003e.","how_to_get_credentials_desc":"Your Secret Key and Public Key are located under \"Profile \u003e API Keys\" on your OneHourTranslation Control panel","how_to_get_credentials_url":"https://wpml.org/translation-service/onehourtranslation/#api-secret-public-keys","client_create_account_page_url":"https://wpml.org/translation-service/onehourtranslation/#create-account","partner":true,"review_url":"https://wpml.org/submit-your-review/?parent_translation-service_id=747801","uses_ate":false,"custom_fields":[{"label":"Secret Key","name":"secret_key","type":"text"},{"label":"Public Key","name":"public_key","type":"text"}],"default_service":0,"translation_feedback":true,"feedback_forward_method":"email","rankings":{"quality":0,"quality_ranking":0.0,"speed":5,"speed_ranking":5510.0,"popularity":2,"popularity_ranking":9.22,"primary":2,"primary_ranking":9.22},"specializations":[{"name":"Technical","key":"technical"},{"name":"Business","key":"business"},{"name":"e-Commerce","key":"e-commerce"}],"countries":[{"name":"Israel","code":"IL"},{"name":"Romania","code":"RO"},{"name":"Ukraine","code":"UA"},{"name":"United States","code":"US"}],"certifications":[],"redirect_to_ts?":true},{"id":21,"name":"Capita","description":"CAPITA TI is a British company which has been translating content for commercial businesses and public sector organizations since 1984. It specializes in legal, financial, manufacturing and e-Learning translations in over 180 languages.","url":"hidden link","logo_url":"hidden link","logo_preview_url":"hidden link","project_details_url":"hidden link{request_id}","add_language_pair_url":"","custom_text_url":"","select_translator_iframe_url":"","translator_contact_iframe_url":"","quote_iframe_url":"","has_translator_selection":false,"project_name_length":128,"suid":"3393562c8687d38db9c447854bd20957","doc_url":"https://wpml.org/translation-service/capita/","notification":false,"tms":false,"has_language_pairs":false,"deadline":true,"oauth":false,"oauth_url":"","popup_message":"","how_to_get_credentials_desc":"The username, password, customer name, and contact name will be provided upon creating a Capita account","how_to_get_credentials_url":"https://wpml.org/translation-service/capita/#connecting-your-site-to-capita","client_create_account_page_url":"hidden link","partner":false,"review_url":"https://wpml.org/submit-your-review/?parent_translation-service_id=893070","uses_ate":false,"custom_fields":[{"label":"Username","name":"username","type":"text"},{"label":"Password","name":"password","type":"text"},{"label":"Customer Name","name":"customer_name","type":"text"},{"label":"Contact Name","name":"contact_name","type":"text"}],"default_service":0,"translation_feedback":true,"feedback_forward_method":"email","rankings":{"quality":0,"quality_ranking":0.0,"speed":0,"speed_ranking":0.0,"popularity":1,"popularity_ranking":8.33,"primary":1,"primary_ranking":8.33},"specializations":[],"countries":[{"name":"United Kingdom","code":"GB"},{"name":"United States","code":"US"}],"certifications":[{"name":"ISO-17100","key":"17100"},{"name":"ISO-27001","key":"27001"},{"name":"ISO-9001","key":"9001"}],"redirect_to_ts?":true}]
}

Screen Shot 2021-01-10 at 6.52.07 PM.png
Screen Shot 2021-01-10 at 6.54.09 PM.png
January 11, 2021 at 6:33 pm #7819481

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Hello,

Please note that we currently are not able to provide support for custom work within this forum. I will, however, try to point you in the correct direction.

If my directions are not enough we suggest contacting one of our 3rd party contractors that specialize in custom work with WPML
https://wpml.org/contractors/

-----------------------------------------

I'd suggest making a slight change to your code to prevent having 2 headers at times.

<?php

if(substr( $_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2 ) == 'es' ) {
header( 'Location: <em><u>hidden link</u></em>' );
}else if( substr( $_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2 ) == 'en' ) {
header( 'Location: <em><u>hidden link</u></em>' );
}else{
header( 'Location: <em><u>hidden link</u></em>' );
}

?>

Additionally please review the following thread as well
https://stackoverflow.com/a/6038460

The topic ‘[Closed] Url title displays redirect on whats app and page not found on FB’ is closed to new replies.