📜  如何用 404 混淆 403 - 无论代码示例

📅  最后修改于: 2022-03-11 14:58:58.489000             🧑  作者: Mango

代码示例1
# with a defined whitelist of app contextroots or directories, rest all can be served with 404 using below rewrite rule 

RewriteEngine On
RewriteCond %{REQUEST_URI} ^((?!\/app1\/).)*$
RewriteCond %{REQUEST_URI} ^((?!\/dir2\/).)*$
RewriteCond %{REQUEST_URI} ^((?!\/dir3\/).)*$
RewriteCond %{REQUEST_URI} ^((?!\/app2\/).)*$
RewriteCond %{REQUEST_URI} ^((?!\/xmlpserver\/).)*$
RewriteRule ^ - [L,R=404]