问题描述
我有一个申请,
我的实际网址是:WWW.MyApplication.com
当我尝试链接实际的URL时,将我带到WWW.MyApplication.com \?GCLID = 9823492374ds32god3298
使用此网址,我的网站无法正确加载,即未显示图片
我必须在我的应用程序中访问GCLID,即当用户使用gclid尝试使用url时,我必须在我的应用程序中删除gclid.
但是有人可以为我提供示例代码或使用GCLID的应用程序.
在此先感谢......
I have one application,
my actual url is: WWW.MyApplication.com
when i tried to link the actual url it takes me to WWW.MyApplication.com\?GCLID=9823492374ds32god3298
with this url my site not loaded properly i.e. images not shown
i have to access GCLID in my application i.e. when user tried the url with gclid, i have to remove gclid in my application.
However could someone please provide me with sample code or an application using GCLID.
Thanks in advance......
推荐答案
<configuration>
<rewriter>
<rewrite url="^~/offers\/[?](.+)
我的原始网址:http://localhost/offers
我将尝试使用URL中的GCLID:http://localhost/offers/?gclid = 23948god238492
尝试使用此URL时,然后web.config文件将URL重写为http://localhost/offers.aspx
然后代码更改为:
My Original URL: http://localhost/offers
I am going to try with GCLID in URL: http://localhost/offers/?gclid=23948god238492
While trying with this url then web.config file rewrite the url to http://localhost/offers.aspx
Then code changes are:
string strRewriteUrl = Request.RawUrl;
if (Request.RawUrl.Contains("gclid"))
{
strRewriteUrl = strRewriteUrl.Replace("/?" + Request.QueryString.ToString(), "");
Response.Redirect("~" + strRewriteUrl, false);
}
这段代码用于删除gclid查询字符串并重定向到原始路径
This code used to remove the gclid query string and redirect to original path
<configuration>
<rewriter>
<rewrite url="^~/offers\/[?](.+)
这篇关于需要使用GCLID的样本应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!