2 回答

TA貢獻2051條經驗 獲得超10個贊
我認為請求 URL 應該是https://www.example.com/image/123/spacer.gif而不是https://www.example.com/image/123/spager.gif。
其次,如果你應用這個規則。請設置為
<match url="^image/([0-9]+)/spacer.gif">
代替
<match url="^/image/([0-9]+)/spacer.gif">
第一個斜杠“/”不包含在此段中。
<rule name="email image tracker" enabled="true" stopProcessing="true">
<match url="^image/([0-9]+)/spacer.gif" />
<action type="Rewrite" url="/image/index.php?id={R:1}" />
</rule>
此規則會將 /image/123/spacer.gif 重寫為 /image/index.php?id=123。但是,由于 php 頁面需要從https://www.example.com/image/123/spacer.gif請求資源 。由于循環,圖像被損壞。
我認為您可以嘗試使用出站規則重寫index.php 中的src 標記。

TA貢獻2037條經驗 獲得超6個贊
我的配置文件位于圖像文件夾內,因此將圖像作為匹配的一部分刪除。
最后也<match ... />失蹤了。/>
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="email_image_tracker" stopProcessing="true">
<match url="^([0-9]+)/spacer.gif" />
<action type="Rewrite" url="/i/index.php?id={R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
- 2 回答
- 0 關注
- 115 瀏覽
添加回答
舉報