通过htaccess的发送404错误? [英] Send a 404 error via htaccess?

查看:139
本文介绍了通过htaccess的发送404错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想切断访问我的网站上的一个子目录,但我想在子目录中的任何访问是一个404错误,而不是403禁止的。如何实现这一点?

I'd like to cut off access to a subdirectory on my site but I want any access in the subdirectory to be a 404 error, not a 403 forbidden. How can this be accomplished?

推荐答案

尝试:

RewriteRule ^directory/ - [L,R=404]

这重定向文件夹的所有请求 /目录/ ,他们得到一个404响应。

This redirects all requests for the folder "/directory/", they get a 404 response.

这篇关于通过htaccess的发送404错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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