2017-02-16 115 views
0

我在包含utm参数的尝试和错误中进行了两次尝试,但是它始终转发到404页面。在url重写条件中包含utm参数

这是我的URL改写目前的状况:

<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&amp;name=$1&amp;$3</to> 
    </rule> 

    <rule> 
     <from>^/(.*)/([0-9]+)$</from> 
     <to last="true" type="forward">/n/force-redirect/fitmycar-webdesign-63?id=$2&amp;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 

我所期望的是,当我去这个页面,我将被重定向到产品页面,与访问此URL时我已被重定向的方式相同:

http://local.xxxxx.com/au/mazda-mazda-3-sedan-2009-2013-boot-mat/5012 

回答

0

获得了回答r通过在条件上添加utm参数:

<rule> 
     <from>^/(.*)/([0-9]+)\?(gclid=.*|utm.*)$</from> 
     <to last="true" type="forward">/n/force-redirect/fitmycar-webdesign-63?id=$2&amp;name=$1&amp;$3</to> 
    </rule>