1

I want my webpage to be in multiple languages on the same domain, for example:

domain.com/en

domain.com/ru

I can manually translate index.html into the languages I need, this is not a problem. I tried to google the solution for hours, in the end I came across only theory. Like what is better: sub-domain or sub-directory. I haven't found any guides on how to implement this. I understand that domain.com/your_language is just folder containing your web-page stuff in a specific language, but I'm pretty sure there is more to set up or adjust for this.

My hosting provider is using apache on a linux machine. Personally, I only have access to the public_html folder.

enter image description here

Personally, I don't care about search engine rankings, because this is my diploma project and I may not publish it in the end.

Would really appreciate it if someone guided me to the right place to get started.

Thank you!

1
  • It's really that simple, you just create a subdirectory for /en and one for /ru in your public_html directory, and place the corresponding translations in those, as detailed here by Google. If you want Google to index them, and they're not already linked to somewhere else that's indexed, you can create a sitemap with <loc> to specify the targeted language, as covered here.
    – dan
    May 21, 2021 at 4:47

2 Answers 2

1

Solved this with .htaccess configuration in root directory thanks to: https://gist.github.com/markhowellsmead/0c414cea619727a3618b

RewriteEngine On

#English
RewriteCond %{HTTP:Accept-Language} ^en [NC]
RewriteRule ^$ /en/ [L,R=301]

#Estonian
RewriteCond %{HTTP:Accept-Language} ^et [NC]
RewriteRule ^$ /ee/ [L,R=301]

#Russian
RewriteCond %{HTTP:Accept-Language} ^ru [NC]
RewriteRule ^$ /ru/ [L,R=301]

What my public_html folder looks like now:

enter image description here

2
  • 1
    You should leave your index.html file in place for user agents that don't send Accept-Language (mostly bots) or send one that isn't one you support. It should have links to your various languages so that users can choose. May 21, 2021 at 16:45
  • I think that I will redirect everyone else to /en/ folder. That'll do for my needs.
    – tslaceo
    May 21, 2021 at 20:01
0

There can be many reasons why your page will not be indexed by Google.

If there are no restrictions for indexing, In general, they act as follows:

First, verify ownership of your site. This can be done in various ways https://support.google.com/webmasters/answer/9008080?hl=en

Then tell Google that there are pages on your site that can be indexed. This can also be done in various ways. Here are the fastest:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.