php如何禁止重定向-PHP问题

资源魔 31 0

计划一:用 Nginx 是能够做到的,需求 ngx_http_referer_module 模块的支持,记患上 reload 失效。能够这么设置装备摆设:

location = /index.php {
    if ($http_referer ~* (www.)?his_site.com) {
        return 403;
    }
}

计划二:正在入口文件 index.php 中手动判别重定向

if ($_SERVER['HTTP_REFERER'] == 'his_stie.com') {
    header('HTTP/1.0 403 Forbidden');
    exit;
}

保举:php效劳器

以上就是php若何制止重定向的具体内容,更多请存眷资源魔其它相干文章!

标签: php php教程 重定向 php故障解决 php使用问题 禁止

抱歉,评论功能暂时关闭!