ds3016 2013-11-25 13:08 采纳率: 100%
浏览 75
已采纳

基于IP地址的重定向[关闭]

Lets say I have domain http://domain.ru and a English visitor visits, it shows me English website based on IP sent him to /eng/ but If a Russian user went on send that person to /ru/

Instead of a User selecting an address I would like to filter only Russia and other countries, meaning that even if your in France you shall visit /eng/ but IF you are in Russia you visit /ru/

Any tips to do this? Or Recommendations?

  • 写回答

3条回答 默认 最新

  • drwpbrv668670 2013-11-25 13:14
    关注

    You can get IP address of incoming request using $_SERVER['REMOTE_ADDR']. See this and this questions on how to map your IP address to a country.

    There are several free SQL database with IP mapping here. They also have API.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试
  • ¥20 问题请教!vue项目关于Nginx配置nonce安全策略的问题
  • ¥15 教务系统账号被盗号如何追溯设备
  • ¥20 delta降尺度方法,未来数据怎么降尺度
  • ¥15 c# 使用NPOI快速将datatable数据导入excel中指定sheet,要求快速高效
  • ¥15 再不同版本的系统上,TCP传输速度不一致