2017-10-06 80 views
0

如何在.htaccess中優化重定向301,而不是爲不同的語言編寫3次!謝謝! ([] =)爲多語言站點優化重定向301

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 
+0

你想/uk/category/1269-name-tovar.html去site.com/ category或site.com/category/1269-name-tovar.html? –

+0

/uk/category/1269-name-tovar.html –

回答

0

該重寫規則將301重定向到[any of your three languages]/category/*https://example.com/category

RewriteEngine On 
RewriteRule ^(ru|en|uk)/category/.+ https://example.com/category [L,R=301] 
+0

那麼你怎麼可以url(1269-name-tovar.html)?重定向將針對另一類別中的所有類別商品? –