【发布时间】:2017-02-16 07:38:24
【问题描述】:
我真的很难根据云耀斑国家代码将重定向放置到我的 .htaccess 文件中。使用本网站上的示例,我要么收到“太多重定向错误”,要么收到 500 个内部错误。
我目前有这个:
Options +FollowSymLinks
RewriteEngine on
SetEnvIf CF-IPCountry "(.*)$" Country=$1
RewriteCond %{ENV:Country} GB
RewriteRule ^(.*)$ http://example.com/$1 [R,L]
所以我需要默认域为http://example.com
但如果国家代码 GB 来自 cloudflare,我需要它重定向到:
以我对 .htaccess 的了解有限,这可能吗?
【问题讨论】:
标签: apache .htaccess redirect geolocation cloudflare