How to disable redirection in php

Release: 2023-02-27 21:10:01
Original
4444 people have browsed it

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; } }
Copy after login

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; }
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!