自定义错误页403 PHP自定义、错误、PHP

2023-09-02 00:49:58 作者:奔跑吧暖男

我创造的,我不希望直接访问该文件的目录内的.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.

 
精彩推荐
图片推荐