Gentlemen, I need your advice, decision, etc.
There is a simple website site, without admin panel, just a set of pages (20 pieces), content in Ukrainian. language, you need to make it grow. version to get the type: site.com.ua \ index.php - in Ukrainian. language and site.com.ua \ ru \ index.php on dew. language.
Done : two folders are created in the root folder of the site. \ Ua i \ ru in each of them there is a completely ready site in the appropriate language with all pages, pictures, etc.
Question : how to combine these two versions? Do I need to create some kind of file of the index.php type in the root folder of the site and prescribe there so that when a request is made in the search engine, the site is displayed in the appropriate query language and so that the default version is available? How to do it?
And question number two : what to register to switch the current page between languages.
- and why on the / ru site do not throw a link to the / ua site and vice versa ?? Well make combobox like on vp for example. Flags fell out there, chose the right one. - Kirill Korushkin
|
2 answers
No “generic version” is needed - this is the last century. The user must enter the site and immediately receive the content. Redirect all those who came "not there" using .htaccess . For example, all of the default helmet immediately to the Ukrainian version:
RewriteEngine On RewriteRule !^(ru/|ua/).* http://site.com/ua/$1 [R=301,L] So you and links in search engines and other sites do not lose.
What about the transition between versions - make a link to the page with the opposite language on the page. It can be text (RU / UA) or as a picture with a flag.
- thank you very much for the answer. but I do not quite understand what the common version means? because I created two multilingual versions of the same site. On account of the transition between the pages I realized, thank you very much !!! - francisko
- Let's say you had a
site.ua/goodpagepage. If you moved it tosite.ua/ua/goodpage, then people who navigate from another site using the old link will see404. To prevent this from happening, I suggest redirecting them to a new link. - Crantisz
|
You can check the browser language in .htaccess like this:
#ru RewriteCond %{REQUEST_URI} ^/$ [NC] RewriteCond %{HTTP:Accept-Language} (ru) [NC] RewriteRule .* https://greatestsiteever.com/ru/ [R=302,L] #ua RewriteCond %{REQUEST_URI} ^/$ [NC] RewriteRule .* https://greatestsiteever.com/ua/ [R=302,L] The user will be redirected to the folder with the localization corresponding to the language of the user's browser.
|