html - 框架 .htaccess 时显示消息

标签 html apache .htaccess

当另一个网站尝试对我的网站进行 iframe 时,我尝试显示错误消息。我正在使用 .htaccess:

header 设置 X-Frame-Options DENY

但是,这只会创建一个空白页面,没有 iframe。是否可以显示错误消息,而不仅仅是空白屏幕?

更新

没有寻找任何 JavaScript 解决方案

最佳答案

您可以在消息中显示自定义错误页面。

ErrorDocument 403 /access.html 

了解更多详情:1。 http://www.hostingmanual.net/fun-with-htaccess-tutorial-examples/

  • http://www.hostingmanual.net/custom-error-messages-htaccess/
  • 关于html - 框架 .htaccess 时显示消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41186475/

    相关文章:

    javascript - 通过以下 HTML lang 值更改内部 HTML

    apache - 如何只允许一个用户代理访问.htaccess?

    html - 导航标题中带有图标的 Bootstrap 搜索字段未正确显示

    javascript - 循环淡入淡出的div

    javascript - 如何从 Highcharts 同一页面上的 HTML DIV 获取 JSON 数据?

    apache - 让 Apache 在请求 header 中接受 LF 与 CRLF

    java - 如何在 web.xml 中设置资源的根路径

    ios - SSL 不适用于移动网站

    .htaccess - 除少数页面和脚本外的所有 HTTPS 到 HTTP

    PHP 站点作为 Drupal 安装中的子文件夹