HTACCESS / ErrorDocument - How to serve 410 instead of 403

江枫思渺然 提交于 2019-12-11 11:38:12

问题


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

Like instead of:

ErrorDocument 403 /403.html 

we need something like this:

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

回答1:


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

ErrorDocument 403 /403.php

And in 403.php use following code:

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


来源:https://stackoverflow.com/questions/16279893/htaccess-errordocument-how-to-serve-410-instead-of-403

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!