Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/16.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
Regex 使用正则表达式从url重写规则中排除thumb文件夹_Regex_.htaccess_Mod Rewrite_Watermark - Fatal编程技术网

Regex 使用正则表达式从url重写规则中排除thumb文件夹

Regex 使用正则表达式从url重写规则中排除thumb文件夹,regex,.htaccess,mod-rewrite,watermark,Regex,.htaccess,Mod Rewrite,Watermark,我想从应用水印中排除缩略图: http:///gallery/photos/4db83e206ae00/4db83e559209e.jpg是 http:///gallery/photos/4db83e206ae00/thumb/4db83e559209e.jpg否您可以执行以下操作: RewriteEngine On RewriteRule ^(.+)\.jpg$ watermark.php?image=$1\.jpg [L] RewriteRule ^(.+)\.gif$ wate

我想从应用水印中排除缩略图:

http:///gallery/photos/4db83e206ae00/4db83e559209e.jpg

http:///gallery/photos/4db83e206ae00/thumb/4db83e559209e.jpg

您可以执行以下操作:

    RewriteEngine On
 RewriteRule ^(.+)\.jpg$ watermark.php?image=$1\.jpg [L]
 RewriteRule ^(.+)\.gif$ watermark.php?image=$1\.gif [L]
 RewriteRule ^(.+)\.png$ watermark.php?image=$1\.png [L]
 RewriteRule ^(.+)\.bmp$ watermark.php?image=$1\.bmp [L]
RewriteCond $1 !/thumb/
RewriteRule ^(.+)\.(jpg|gif|png|bmp)$ watermark.php?image=$0 [L]