保护没有标题的网页

hel*_*dre 3 php security http-headers

我刚读过tdwtf.com上的这篇文章.通常,它描述了一个销毁机器人,因为它忽略了标题.然后我意识到我不知道如何在没有标题的页面中进行安全性.因此我的问题是:

除了使用标题之外,我还可以采取哪些安全措

我主要用php开发,所以我熟悉header("Location:")函数.但还有什么呢?

理想情况下,我正在寻找替代逻辑

if (!$something_important) header("Location: somehereharmless.php");
Run Code Online (Sandbox Code Playgroud)

用别的东西(更多)安全吗?

Ale*_*ekc 7

这个很好用

if (!$something_important) {
  header("Location: somehereharmless.php");
  exit();
}
Run Code Online (Sandbox Code Playgroud)

即使它是机器人,所以它不尊重Location,你会调用一个出口,所以执行流程无论如何都会停止,所以没有伤害