I found lots of topics on how to localize a website and most common solutions have been adding subdomains or creating different subdirectories(eg. "/en/"). However I could not find anything that worried about loosing Google indexing for sites that originally were localized for only one language.
Since now, Google managed to index pages like this:
http://website.com/threads/this-is-the-title/11111
Whenever I decide to opt for localizations in different sub-directories, it would be:
http://website.com/en/threads/this-is-the-title/11111
What will happen to the hundreads of pages index by Google? Can you help me figuring out a solution to localize a website without having trouble with Google?
What I found that partially solves the problem
Hreflang: https://support.google.com/webmasters/answer/189077?hl=en
This would work except for the fact that I'll find myself with localization on two different folder levels:
/
...files of already index content
/en
...files of the second language
Update:
Current htaccess file:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^threads/(?:([a-zA-Z0-9-_]+\/)?)([0-9]+)$ thread.php?qid=$2 [QSA,L]
...other
I turned that line into:
RewriteRule ^(?:([a-zA-Z]+\/)?)threads/(?:([a-zA-Z0-9-_]+\/)?)([0-9]+)$ $1/thread.php?qid=$3 [QSA,L]
This is not enough, since it does not redirect to a localized sub-directory.
Use .htaccess and mod-rewirte to tell google that the url has moved to another uri
for example
RewriteEngine On
RewriteRule ^oldsite\.html$ /newsite.html [R=301,L]
And google is fine with you
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.