我在我的网址上包含utm params以进行tuckey url重写时做了几次尝试和错误,但它总是转发到404页面。
这是我目前关于网址重写的条件:
<rule>
<from>^/n/(.*)/([0-9]+)$</from>
<to last="true" type="permanent-redirect">/ttsvr/$1/$2</to>
</rule>
<rule>
<from>^/(.*)/([0-9]+)\?(gclid=.*)$</from>
<to last="true" type="forward">/n/force-redirect/fitmycar-webdesign-63?id=$2&name=$1&$3</to>
</rule>
<rule>
<from>^/(.*)/([0-9]+)$</from>
<to last="true" type="forward">/n/force-redirect/fitmycar-webdesign-63?id=$2&name=$1</to>
</rule>
这是转发到404的网址:
http://local.xxxxx.com/au/mazda-mazda-3-sedan-2009-2013-boot-mat/5012?utm_source=reengagement-campaign&utm_campaign=email1&utm_medium=email&utm_content=button1
我期望的是,当我转到此页面时,我将被重定向到产品页面,与访问此网址时重定向的方式相同:
http://local.xxxxx.com/au/mazda-mazda-3-sedan-2009-2013-boot-mat/5012
答案 0 :(得分:0)
通过在条件中添加utm params得到答案:
<rule>
<from>^/(.*)/([0-9]+)\?(gclid=.*|utm.*)$</from>
<to last="true" type="forward">/n/force-redirect/fitmycar-webdesign-63?id=$2&name=$1&$3</to>
</rule>