Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.htaccess RegEx在htaccess with filesmatch中查找文件名中包含特定单词的图像_.htaccess - Fatal编程技术网

.htaccess RegEx在htaccess with filesmatch中查找文件名中包含特定单词的图像

.htaccess RegEx在htaccess with filesmatch中查找文件名中包含特定单词的图像,.htaccess,.htaccess,我在找一个合适的正则表达式。我想用filematch保护文件名中有特定单词的所有jpg图像。单词should是“Preview”,我需要这个,我需要同样的来查找文件名中没有“Preview”的所有图像 <FilesMatch "!=preview\jpg"> Order Deny,Allow Deny from all Allow from development.url.com Allow from 85.13.139.234 <

我在找一个合适的正则表达式。我想用filematch保护文件名中有特定单词的所有jpg图像。单词should是“Preview”,我需要这个,我需要同样的来查找文件名中没有“Preview”的所有图像

    <FilesMatch "!=preview\jpg">
    Order Deny,Allow
    Deny from all
    Allow from development.url.com
    Allow from 85.13.139.234
    </FilesMatch>

    <FilesMatch "==preview\jpg">
    Order Deny,Allow
    Deny from all
    Allow from development.url.com
    Allow from 85.13.139.234
    </FilesMatch>

命令拒绝,允许
全盘否定
允许从development.url.com访问
允许从85.13.139.234开始
命令拒绝,允许
全盘否定
允许从development.url.com访问
允许从85.13.139.234开始
像这样,一个是“预览”,一个是==“预览”;)第三个选择所有jpg图像也很好:)


谢谢:)

您可以使用Files指令进行正则表达式匹配:

<Files ~ "preview">...</Files>
。。。

我需要找到文件名中没有“预览”字样的所有图像,并使用FilesMatch!谢谢