繁体   English   中英

RedirectMatch RegEx-需要有一个例外

[英]RedirectMatch RegEx — Need to have an exception

我有此RedirectMatch指令:

RedirectMatch 404 (.old|.csv|.txt|.sql|.ini)$

我现在想排除robots.txt,但继续为所有其他.txt发送404。 怎么样?

我看着RedirectMatch 403摆弄了它-.htaccess 中的1个URL需要有一个例外,但我无法使其工作。

你能帮我吗?

您可以使用负向后看

RedirectMatch 404 (.old|.csv|(?<!robots).txt|.sql|.ini)$

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM