這個外掛並未在最新的 3 個 WordPress 主要版本上進行測試。開發者可能不再對這個外掛進行維護或提供技術支援,並可能會與更新版本的 WordPress 產生使用上的相容性問題。

WP Cloudflare GeoIP Redirect

描述

WP Cloudflare GeoIP Redirect plugin enables you to setup redirect for users from selected countries to specific URL.

Geolocation is done using Cloudflare IP Geolocation data.

Redirection is done using the php header() function and you can choose Temporary Redirect (307) or Moved Permanently (301).

In order to use this plugin you need to setup Cloudflare for your website and enable Cloudflare IP Geolocation service. More info in FAQ.

螢幕截圖

  • Basic setup for one country redirect
  • Setup for redirecting users from multiple countries to same URL

安裝

  1. Upload the plugin files to the /wp-content/plugins/wp-cloudflare-geoip-redirect directory, or install the plugin through the WordPress plugins screen directly.
  2. Activate the plugin through the ‘Plugins’ screen in WordPress
  3. Use the CF Redirect>Options screen to configure the plugin

常見問題

Do I need a Cloudflare account to use the plugin?

You don’t need CloudFlare account credentials for using plugin but you do need to have Cloudflare service active on your domain in order for plugin to get Geolocation user data and enabled Cloudflare IP Geolocation.

How to enable Cloudflare IP Geolocation

For info on how to configure Cloudflare IP Geolocation follow the link: https://support.cloudflare.com/hc/en-us/articles/200168236-Configuring-Cloudflare-IP-Geolocation

Will this plugin work with other Caching plugins?

Frankly we don’t know yet. As of v1.3 new HTTP header is added when redirection is enabled (Cache-Control: no-cache, no-store, must-revalidate) but it’s on cache plugin to honor this setting

LiteSpeed Cache plugin workaround if redirection is not working

This issue is fixed by adding new rule to your .htaccess file before ## LITESPEED WP CACHE PLUGIN section

RewriteEngine On
RewriteRule .* – [E=Cache-Control:vary=%{HTTP:CF-IPCountry}]

You can read more about it here https://wordpress.org/support/topic/wp_redirect-not-working-with-litespeed-cache-on/#post-14280128

評價

2021年4月22日
Very appreciated to the developer for his plugin and support! This is the the best free solution for wp + Cloudflare with such functionality. The upcoming update comes with new mega features! Very recommend! Try by yourself, you'll get what I mean. All preferences are user-friendly, the plugin is lightweight with high code quality. Thank you so much!!!
2021年4月6日
I tried a couple of redirect plugins but this was the only one that worked as expected. Tech support is superb cause they made it work perfectly in a multisite and LSCache enabled. Thank you so much for everything
2021年1月22日 1 reply
Plain and simple. CloudFlare IP Geolocation enabled. Plugin set up and settings saved. Country detected correctly and displayed on plugin settings page. Redirection not happening (no matter whether it's 307 or 301). Shame. Will have to do it by hand in .htaccess
閱讀全部6個評價

貢獻者及開發者

“WP Cloudflare GeoIP Redirect” 是一個開源的軟體。以下的人對這個外掛作出了貢獻。

貢獻者

WP Cloudflare GeoIP Redirect 外掛目前已有 2 個本地化語言版本。 感謝所有譯者為這個外掛做出的貢獻。

將 WP Cloudflare GeoIP Redirect 外掛本地化為台灣繁體中文版。

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

修改日誌

1.4

  • option to add custom Query string parameter name and value to current URL based on redirect settings

1.3

  • fixed redirect loop issue when website url is same as redirect url
  • added HTTP header “Cache-Control: no-cache, no-store, must-revalidate”
  • after working with “LiteSpeed Cache” to fix the issues with redirect not working when caching is enabled workaround is added to FAQ

1.2

  • changed redirect code to use “wp_redirect”

1.1

  • Added CMB2 framework for plugin options

1.0

  • First release