Regex 如何将apache url重写规则转换为IIS规则?
我的.htaccess文件上有如下url重写规则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问
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>