Home > Article > Backend Development > How to disable redirection in php
Option 1: It can be done using Nginx. It requires the support of the ngx_http_referer_module module. Remember to reload to take effect. It can be configured like this:
location = /index.php { if ($http_referer ~* (www.)?his_site.com) { return 403; } }
Option 2: Manually determine the redirection in the entry file index.php
if ($_SERVER['HTTP_REFERER'] == 'his_stie.com') { header('HTTP/1.0 403 Forbidden'); exit; }
Recommended: php server
The above is the detailed content of How to disable redirection in php. For more information, please follow other related articles on the PHP Chinese website!