A
A
awe2019-11-25 21:11:14
Apache HTTP Server
awe, 2019-11-25 21:11:14

How to redirect site.com to site.ru/en/ using .htaccess?

No parameters, just as stated in the question.
* site.ru and site.com are directed to the same hosting directory.
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
DanielMcRon, 2019-11-25
@DanielMcRon

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^site.com [NC]
RewriteRule ^(.*) site.ru/en/$1 [L,R=301]
If you need something else then here https://www.ukraine.com .ua/faq/kak-sdelat-pereadre...

V
Viktor Taran, 2019-11-25
@shambler81

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^site.com [NC]
RewriteCond %{REQUEST_URI} !^/en(\/|$
RewriteRule ^(.*) https://site.ru/en/$1 [R,L=301]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question