自定义错误 403 页面 PHP [英] Custom Error 403 Page PHP

查看:39
本文介绍了自定义错误 403 页面 PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在不希望直接访问文件的目录中创建了一个 .htaccess.它工作并触发 Apache 服务器的默认 403 页面(禁止访问!).如何创建自定义 403 页面?谢谢!

I created a .htaccess inside a directory in which I don't want the files to be directly accessed. It works and fires the default 403 page (Access forbidden!) of the Apache server. How can I create a custom 403 page? Thanks!

推荐答案

在您的 .htaccess 文件中,您可以指定要作为默认 403 错误文档的文档.

In your .htaccess file you can specify what document you want as your default 403 error document.

ErrorDocument 403 /dir/file.html

这里的目录是相对于文档根目录的.

Here the directory is relative to the document root.

这篇关于自定义错误 403 页面 PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆