我想阻止htaccess中的某些路径和文件类型。
我有这样的正则表达式:\/(libs|public)\/(.*).*\.(css|js|jpe?g|png|bmp|ttf)
在测试服务器https://regex101.com/上很好用
对于我的示例字符串:/libs/test/any.css?number=123
。
当我将条件移至htaccess时,允许使用示例字符串。但是它必须用403阻止,因为它以libs
字符串开头。
<If "%{REQUEST_URI} =~ m#^/(libs|public)/(.*).*\.(css|js|jpe?g|png|bmp|ttf)#">
order allow,deny
deny from all
satisfy all
</If>
因为我想阻止以我的条件(libs | public)开始的路径。
此请求/allowedfiles/libs/test/any.css?number=123
不得被阻止。
请帮助我做错什么了
答案 0 :(得分:0)
尝试以下操作,它需要mod_rewrite。
// allowSyntheticDefaultImports: false
import * as express from 'express' // good
import express from 'express' // error
// allowSyntheticDefaultImports: true
import * as express from 'express' // good
import express from 'express' // good