Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.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 .htacces仅在文件不存在时重定向_.htaccess - Fatal编程技术网

.htaccess .htacces仅在文件不存在时重定向

.htaccess .htacces仅在文件不存在时重定向,.htaccess,.htaccess,htaccess对服务文件夹的访问 RewriteRule ^images\/(\d+)\/i_(\d+)_p_([\w|\+|\-|\%|\!|\?]+) images.asp?k=$1&i=$2&p=$3 [QSA,L] 我需要它这样做: 如果文件系统上不存在文件,则激活上述规则。如果文件存在,则使用该文件。如果文件系统不存在,Images.asp会将这些文件放入文件系统。您必须使用RewriteCond%{REQUEST\u FILENAME}-f以确保请求的文件不存在

htaccess对服务文件夹的访问

RewriteRule ^images\/(\d+)\/i_(\d+)_p_([\w|\+|\-|\%|\!|\?]+) images.asp?k=$1&i=$2&p=$3 [QSA,L]
我需要它这样做:


如果文件系统上不存在文件,则激活上述规则。如果文件存在,则使用该文件。如果文件系统不存在,Images.asp会将这些文件放入文件系统。

您必须使用
RewriteCond%{REQUEST\u FILENAME}-f
以确保请求的文件不存在。您还可以稍微改进您的正则表达式,使其:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^images/(\d+)/i_(\d+)_p_([^.]+) images.asp?k=$1&i=$2&p=$3 [QSA,L,NC]