我使用 Virtualmin 作为我的 ubuntu 服务器的控制面板。每次我创建新的虚拟服务器时,当我访问网站时,它都会显示
Forbidden
You don't have permission to access / on this server.
发生这种情况是因为我没有上传任何文件到服务器。
我想问一下如何自定义那个禁止信息。例如,我想放一句话要求用户上传文件到服务器,例如:
Forbidden
You don't have permission to access / on this server. If you have recently created a new account, please go ahead and upload your files to server. Thanks!
谢谢你的帮助 :)
答案1
您可以在 Apache 中使用“ErrorDocument”指令。您可以将代码放在全局(服务器)配置中,也可以放在每个虚拟主机中。
例如...
ErrorDocument 403 "You don't have permission to access / on this server. If you have recently created a new account, please go ahead and upload your files to server. Thanks!"