This thread is resolved. Here is a description of the problem and solution.
Problem: The client wanted to know if it's possible for the main language (Armenian) to show its language code 'hy' in the URL slug, similar to how the Russian version shows 'ru'.
Solution: We recommended adding PHP code to the client's theme to redirect the root domain to the directory of the default language. Here are the steps: 1. Create a PHP template file for the site's theme, preferably in a child theme. 2. Add the following PHP code to the new template file:
3. Edit the root page and select the newly created template from the Summary section in the right sidebar. 4. Update the page to ensure the root page now redirects to the default language directory.
Please note that this solution might be irrelevant if it's outdated or not applicable to your case. If the issue persists, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If you still need assistance, please open a new support ticket with us.
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.
ARMENIAN LANGUAGE IS MY MAIN LANGUAGE . IN THE SLUG I DONT SEE WORD ,,HY,, SE PLS SCREENSHOT 1.
IN RUSSIAN VERSION I SEE WORD ,,RU,, WHICH I THINK IIS NORMALLY.
I WOULD LIKE KNOW CAN I IN ARMENIAN ( ITS MAIN LANGUAGE ) I ALSO SEE ,,HY,, ?
---------------------------------------------------------------------------------------------------
FRANKLY I SAW OTHER WEVSITES AND COMPARE WITH T-SHOES.ONLINE.
IN THE INTERNET I SEE BOTH VERSION
1. MAIN LANGUAGE SHOEW ,,HY,,
2 MAIN LANGUAGE DONT SHOW ANYTHING.
------------------------------------------------------------------------------------------
I PREFER OPTIOIN 1 ABOVE , WHEN MAIN LANGUAGE ALSO SHOW ,,HY,, - IS THAT POSSIBLE ?
THANK
SINCERLEY ARMEN
BUT I HAVE 1 QUESTION
SEE PLS SCREENSHOT 15
THERE APPEAR RADIO BUTTON ,, A PAGE CREATE ROOT PAGE ,, AND NOW LANGUAGE URL FORMAT LOOKS LIKE ON SCREENSHOT 15.
MY QUESTIOIN IS
,, IS THAT NORMALLY AND DO I ALL THING RIGHT ,, ???
THANKS
SINCERELY ARMEN
The Root page option there is for scenarios that the visitor will go to the main domain of the website For example:
hidden link
In such scenarios, it is recommended that you create a root page which will be the starting point of your website and you can add a language switcher there when the customer can decide which language to choose.
But if you do not want such a page, you can always use the method below to redirect the main domain to the URL with the default language code.
HI DR Christopher Amirian
I UNDERSTAND MEANING OF ROOT PAGE AND I DONT WANT USE IT. I WOULD LIKE REDIRECT MAIN LANGUAGE PAGE .
NOW LANGUAGE URL FORMAT LOOKS LIKE ON SCREENSHOT 3 ... I PUT THERE URL hidden link . IS THAT RIGHT ?
--------------------------------------------
I THINK NOW I HAVE SECOND PROBLEM, OR ISSUE .
IF I USE URL WITHOUT ,,HY,, THEN WEBSITE SHOW BLANK PAGE / SEE PLS SCREENSHOT 4 / - I THINK ITS NOT NORMALLY ? RIGHT ? HOW CAN I FIX IT ?
THANKS
SINCERELY ARMEN
You will need to add the PHP code mentioned in the documentation I shared, so when the domain is typed without HY it automatically redirects to HY:
Sometimes, you might want to redirect your root domain to the directory of the default language. In other words, if English is the default language and someone visits hidden link, they are redirected to hidden link.
Start by creating a PHP template for your site’s theme. In most cases, you should add such PHP files to a child theme.
Add the following content to your new PHP page template file:
HI DR AMIRIAN - THANKS FOR HELPING !!!
I CREATED ROOT PAGE BUT I CANT PUT CODE IN NEW PHP PAGE TEMPLATE BCOZ I AM NOT GOOD USER AND ASK TO HELP ME THEME SUPPORT . PLS GIVE ME 1-2 DAYS TILL THEY WILL SOLVE FOR ME ISSUE .
THANKS FOR UNDERSTANDING
SINCERELY ARMEN
If you provide the login information and permission I can do that for you.
I'd appreciate it if you could give me the URL/User/Pass of your WordPress dashboard after you make sure that you have a backup of your website.
It is absolutely important that you give us a guarantee that you have a backup so if something happens you will have a point of restore.
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.