[av_one_full first min_height=" vertical_alignment=" space=" custom_margin=" margin='0px' link=" linktarget=" link_hover=" padding='0px' border=" border_color=" radius='0px' background='bg_color' background_color=” background_gradient_color1=” background_gradient_color2=” background_gradient_direction='vertical' src=” background_position='top left' background_repeat='no-repeat' animation=” mobile_breaking=” mobile_display=” av_uik='av-
[av_heading heading='Foreign trade website blocks Chinese browser users' tag='h3′ link_apply=” link=” link_target=” style=” size=” subheading_active=” subheading_size='15' margin=” padding='10' color ="custom_font="custom_class="admin_preview_bg="av-desktop-hide="av-medium-hide="av-small-hide="av-mini-hide="av-medium-font-size-title="av-medium-font-size-title=" av-small-font-size-title=”av-mini-font-size-title=”av-medium-font-size=”av-small-font-size=”av-mini-font-size=”av_uid ='av-2w4789'][/av_heading]
[av_textblock size=" font_color=" color=" av-medium-font-size=" av-small-font-size=" av-mini-font-size=" av_uid='av-jo5sanac' admin_preview_bg="]
Foreign trade websites are often afraid that their peers will view their own websites, so they need to block their peers. In addition to blocking the specified IP, we can specify the browser language to block all Chinese users
Blocking Chinese IP: One bad thing is that if the customer comes to China, they can’t see it, so a VPN is necessary
The following code can block all Chinese browser language users and automatically jump to the specified URL, please modifyhttps://5566.site/ComingSoon.htmlThis URL is yours, but I personally think this is not very friendly, we can upload a simple static page ComingSoon.html to the root directory (write this page yourself). Let him jump to this page.
Finally, use the method as follows:
After the code has been changed, put it in the statistical code of the theme, or write it under the theme footer.php, and any page that visits the whole site will perform a jump
ComingSoon.html is placed in the root directory, because it is static, it will not be affected by the code.
If you need the page file ComingSoon.html, please leave a message.
[/av_textblock]
[/av_one_full]
[av_one_full first min_height=" vertical_alignment='av-align-top' space=" margin='0px' margin_sync='true' link=" linktarget=" link_hover=" padding='50px' padding_sync='true' border=" border_color=” radius='0px' radius_sync='true' background='bg_color' background_color='#f7f7f7′ background_gradient_color1=” background_gradient_color2=” background_gradient_direction='vertical' src=” attachment=” attachment_size=” background_position='top left' background_repeat ='no-repeat' animation="mobile_breaking="mobile_display="av_uid='av-jo5scrh3']
[av_codeblock wrapper_element=” wrapper_element_attributes=” codeblock_type=” escape_html='aviaTBescape_html' av_uid='av-jo5s6arx']
if (navigator.language)
var language = navigator.language;
else
var language = navigator.browserLanguage;
if(language.indexOf('zh') > -1)document.location.href = 'https://5566.site/ComingSoon.html';
[/av_codeblock]
[/av_one_full]