【问题标题】:Redirect User based on hostname根据主机名重定向用户
【发布时间】:2014-02-05 07:29:32
【问题描述】:

这个想法是将用户组 A 的主机名中带有“aaa”的重定向到 url.com/a/ 并将主机名中带有“bbb”的用户组 B 发送到 url.com/b/

希望有任何提示!

【问题讨论】:

    标签: redirect hostname cloaking


    【解决方案1】:
    <?php
    $path = $_SERVER["DOCUMENT_ROOT"];
    //This will get the path where the user is
    if($path == "a"){
    Header("Location: http://url.com/b/");
    //this will redirect the user to b folder
    }
    ?>
    

    这会将 a 文件夹中的用户重定向到 b 文件夹。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-01-12
      • 1970-01-01
      • 2020-07-21
      • 2015-12-08
      • 1970-01-01
      • 2016-06-08
      • 1970-01-01
      • 2012-05-01
      相关资源
      最近更新 更多