【已完成】宝塔里怎么设置Nginx跳转外部域名
我的网站是PHP比如我的网站域名, www.xxxxx.com,禁止跳转到不属于我自己域名下的连接
PHP的跳转代码,跳转到外部网站,不被应许
header("Location: http://www.example.com");
直接输出通过JS方式跳转,跳转到外部网站,不被应许
$a = '<script type="text/javascript">window.location.href = "https://www.example.com";</script>';
只要不属于我的站点域名www.xxxxx.com,任何跳转方式都将拦截下来 返回404
下面配置为通过if判断host是否为www.xxxxx.com,如果不是,则返回404,仅供参考:
location / {
if ($http_host !~* ^www.xxxxx.com$) {
return 404;
}
页:
[1]