计划一:用 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怎样制止重定向的细致内容,更多请关注ki4网别的相干文章!