我正在尝试在我的IIS 10上托管的wordpress网站上安装以下插件:https://wordpress.org/plugins/media-vault/ 该插件需要在服务器上安装一些URL重写规则,并且当我使用IIS时,插件无法通过.htaccess设置这些规则。我现在正在尝试将规则转换为IIS,但它似乎没有那样工作,因为插件不允许我继续安装。所需的规则是:
# Media Vault Rewrite Rules
RewriteRule ^wp-content/uploads(/_mediavault/.*\.\w+)$ index.php?mgjp_mv_file=$1 [QSA,L]
RewriteCond %{QUERY_STRING} ^(?:.*&)?mgjp_mv_download=safeforce(?:&.*)?$
RewriteRule ^wp-content/uploads(/.*\.\w+)$ index.php?mgjp_mv_file=$1 [QSA,L]
# Media Vault Rewrite Rules End
这就是我在IIS上的web.config所说的:
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^wp-content/uploads(/_mediavault/.*\.\w+)$" ignoreCase="false" />
<action type="Rewrite" url="index.php?mgjp_mv_file={R:1}" appendQueryString="true" />
</rule>
<rule name="Imported Rule 2" stopProcessing="true">
<match url="^wp-content/uploads(/.*\.\w+)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{QUERY_STRING}" pattern="^(?:.*&)?mgjp_mv_download=safeforce(?:&.*)?$" ignoreCase="false" />
</conditions>
<action type="Rewrite" url="index.php?mgjp_mv_file={R:1}" appendQueryString="true" />
</rule>
有没有我错过的东西?
提前谢谢!