亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

IIS URL 重寫重定向到圖像以跟蹤電子郵件視圖

IIS URL 重寫重定向到圖像以跟蹤電子郵件視圖

PHP
翻閱古今 2023-10-15 15:43:22
我正在嘗試根據請求圖像的文件夾名稱構建一個電子郵件跟蹤器。例子:https://www.example.com/image/123/spager.gif需要變成這個https://www.example.com/image/index.php?id=123作為回報,它將提供 spacer.gif 圖像。這可行嗎?如果是的話,我錯過了什么?所以票價我得到了這個:網絡配置:<rule name="email image tracker">  <match url="^/image/([0-9]+)/spacer.gif">  <action type="Rewrite" url="/image/index.php?id={R:1}" /></rule> 索引.php:<?php  header('Content-type: image/gif');  $png_image = imagecreate(150, 150);  imagecolorallocate($png_image, 15, 142, 210);?>但我收到錯誤:由于發生內部服務器錯誤,該頁面無法顯示。日志文件中沒有任何內容可以幫助我獲得有關哪些內容不起作用的提示。
查看完整描述

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 標記。

https://img1.sycdn.imooc.com/652b98560001b38504560094.jpg

https://img1.sycdn.imooc.com/652b985c0001c03605010133.jpg

查看完整回答
反對 回復 2023-10-15
?
阿晨1998

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>


查看完整回答
反對 回復 2023-10-15
  • 2 回答
  • 0 關注
  • 115 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號