Good day! I dig in wordpress. To close the site from Russian and Ukrainian users I try to use this script in .htaccess

RewriteEngine on RewriteCond %{REQUEST_URI} ^/$ [NC] # что тут дописать? RewriteCond %{HTTP:Accept-Language} (ru|uk) [NC] RewriteRule .* http://ru.site.com/ [R=302,L] RewriteCond %{REQUEST_URI} ^/$ [NC] RewriteRule .* http://site.com/ [R=302,L] 

In this case, the subdomain ru.site.com is a stub page - Maintenance mode

Question: Now when a user visits site.com via a Russian or Ukrainian browser, then the redirect works on ru.site.com

But when you click a link to the site.com/category/post page a redirect to ru.site.com does not work.

What do I need to add to the code so that the user can go to site.com/category/post and redirect to ru.site.com like it is now from site.com?

Help solve the issue. Thank!

  • Remove the line RewriteCond %{REQUEST_URI} ^/$ [NC] # что тут дописать? . And the last two lines are not at all clear why they are needed here. - Visman
  • That decision did not help - Kenno
  • So your browser may have cached behavior. Try on another page to open a website or browser cache. - Visman

0