F
F
Funny_Man2017-08-07 11:56:01
PHP
Funny_Man, 2017-08-07 11:56:01

How to make a redirect from the main site to the specified one, for a person from a specific country?

How to write a command in .htaccess so that a client from one country (let's say China) is redirected to a special page?
In order not to output 403.
403 I output like this:
RewriteEngine On
RewriteCond %{HTTP:GeoIp-Country-Code} ^(CN|HK)$
RewriteRule .* - [F]

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Timofeev, 2017-08-07
@webinar

How do you live without Google: https://unihost.com/help/ru/htaccess-and-geoip/

M
Mikhail Lyalin, 2017-08-07
@mr_jok

it is best not to impose this kind of "automation" on site visitors

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question