Home  >  Article  >  Backend Development  >  How to disable redirection in php

How to disable redirection in php

尚
Original
2019-10-28 14:07:144465browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:php cannot receive dataNext article:php cannot receive data