Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/20.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 如何将apache url重写规则转换为IIS规则?_Regex_Apache_.htaccess_Iis_Url Rewriting - Fatal编程技术网

Regex 如何将apache url重写规则转换为IIS规则?

Regex 如何将apache url重写规则转换为IIS规则?,regex,apache,.htaccess,iis,url-rewriting,Regex,Apache,.htaccess,Iis,Url Rewriting,我的.htaccess文件上有如下url重写规则 RewriteEngine on RewriteRule ^(scripts|css)/(.+)\.(.+)\.(js|css)$ $1/$2.$4 [L] 我需要在我的IIS上使用相同的规则 我使用了^(.*)\.[d]{10}\.(css|js)作为模式。 我不知道该说什么重写URL 我想将url/css/structure.1234.css重写为/css/structure.css 有人知道请帮忙吗?我读了您的另一个ColdFusion问

我的.htaccess文件上有如下url重写规则

RewriteEngine on
RewriteRule ^(scripts|css)/(.+)\.(.+)\.(js|css)$ $1/$2.$4 [L]
我需要在我的IIS上使用相同的规则

我使用了
^(.*)\.[d]{10}\.(css|js)
作为模式。 我不知道该说什么
重写URL

我想将url
/css/structure.1234.css
重写为
/css/structure.css


有人知道请帮忙吗?

我读了您的另一个ColdFusion问题(关于使用正则表达式向文件名添加数值)

我们使用下划线和14位的日期戳。下面是我们使用的IIS重写规则。您可以根据需要对其进行修改

<rule name="CSSJSDatestamp" stopProcessing="true">
    <match url="^(.*)(_[0-9]{14}\.)(css|js)$" />
    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
        <add input="{SCRIPT_NAME}" pattern="/_scripts/" />
    </conditions>
    <action type="Rewrite" url="{R:1}.{R:3}" />
</rule>