HTACCESS / ErrorDocument-如何提供410而不是403 [英] HTACCESS / ErrorDocument - How to serve 410 instead of 403

查看:112
本文介绍了HTACCESS / ErrorDocument-如何提供410而不是403的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以告诉我如何使用服务器410而不是403(不提供403中的任何html页面)吗?

Can anyone please tell me how to server 410 instead of 403 (without serving any html page in 403)?

喜欢而不是:

ErrorDocument 403 /403.html 

我们需要这样的东西:

ErrorDocument 403:410 #/i.e. 403 will show default browser's 410/Gone error


推荐答案

仍然找不到任何解决方案,请尝试以下解决方法

文件:.htaccess

If you still didn't find any solution try this one
file: .htaccess

ErrorDocument 403 /403.php

在403.php中,使用以下代码:

And in 403.php use following code:

<?php header("HTTP/1.0 410 Gone"); ?>

这篇关于HTACCESS / ErrorDocument-如何提供410而不是403的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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