【发布时间】:2014-11-15 20:19:36
【问题描述】:
我目前在我的 htaccess 中设置了地理重定向,以将访问 example.com 的亚洲用户重定向到 asia.example.com。我现在想知道如何覆盖该重定向,以便来自 asia.example.com 的用户可以通过 asia.example.com 上的链接访问 example.com。
这可能吗?或者我必须使用客户端重定向吗?我将如何进行设置。
一些背景信息 example.com 正在运行 Magento,asia.example.com 将成为现在的登录页面。
谢谢
更新:我的主机说我应该在 Magento 上安装这个 https://github.com/maxmind/GeoIP2-php... 我该怎么做?
评论更新:
# Redirect multiple countries to a single page
RewriteEngine on
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^(VN|SG|CN|MY|JP|KP|KR)$
RewriteRule ^(.*)$ asia.example.com$1 [R,L]
【问题讨论】:
-
请出示来自
.htaccess的重定向代码 -
# 将多个国家重定向到一个页面 RewriteEngine on RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^(VN|SG|CN|MY|JP|KP|KR)$ RewriteRule ^(.*)$ @ 987654322@ [R,L]
标签: .htaccess magento redirect geolocation magento-1.7