A
A
Anton2018-07-24 18:52:05
Apache HTTP Server
Anton, 2018-07-24 18:52:05

Redirect (redirect only if domain + url matched) on a multi-domain site?

There is a WordPress site that uses the WPML translation plugin and has several languages ​​configured: .com .ru .es but with a single code base. In other words, the .htaccess file (like everyone else) is the same for all domains.
The SEOs insisted on renaming the URL from English to their own language. And then, of course, you need to specify redirects, as the webmaster found duplicate pages.
Example: If the url is site.ru/prop/name then redirect to site.ru/prop/1234-nazvanie
Googled Here is the code:
RewriteCond %{HTTP_HOST} ^(.*)?site. en [NC]
RewriteRule /prop/name/ /prop/1234-nazvanie/ [R=301,L]
RewriteRule /prop/other-name/ /prop/1234-drugoie-nazvanie/ [R=301,L]
And so many many lines...
RewriteCond %{HTTP_HOST} ^(.*)?site. es [NC]
RewriteRule /prop/name/ /prop/1234-nombre/ [R=301,L]
RewriteRule /prop/other-name/ /prop/1234-otro-nombre/ [R=301,L]
And so many many lines...
I would like to understand how ok it is in this case? And how well is this code written?
The server is not dedicated.
To all who are in the subject Thank you. I will be glad to hear recommendations and comments.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Taran, 2019-05-16
@shambler81

SEO specialist can be stumped with pissed rags.
the expediency of changing all the urls on the site just to get transliteration in your own language is, to put it mildly, doubtful.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question