针对多语言站点优化重定向301 [英] Optimize Redirect 301 for a multilingual site
本文介绍了针对多语言站点优化重定向301的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在.htaccess中优化重定向301,而不要为不同的语言编写3次!谢谢! ([。] =。)
How to optimize Redirect 301 in .htaccess, not to write 3 times for different languages! Thank you! ( [.] = . )
Redirect 301 /ru/category/1269-name-tovar.html https://site[.]com/category
Redirect 301 /en/category/1269-name-tovar.html https://site[.]com/category
Redirect 301 /uk/category/1269-name-tovar.html https://site[.]com/category
推荐答案
此重写规则将301将 [您的三种语言中的任何一种] / category / *
重定向到 https://example.com/category
This rewrite rule would 301 redirect [any of your three languages]/category/*
to https://example.com/category
RewriteEngine On
RewriteRule ^(ru|en|uk)/category/.+ https://example.com/category [L,R=301]
这篇关于针对多语言站点优化重定向301的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文