-
Oct 9th, 2021, 10:18 PM
#1
Thread Starter
New Member
Removing Facebook tags from querystring
Hi...I had some VB stuff written for me ages ago. All works fine. But now, when pages from this site are put on Facebook, the Facebook links always append "?fbclid=" and then a massive long string.
So my URL may from
http://www.mysite.com/thepage
to
http://www.mysite.com/thepage?fbclid...__tn__=-UK-R&c[0]=AT3udzUg6o1Ni-LiWLzfiw1-Fd5nTKf5KLk2o5SYdjfhid3LhpLD7bv7m2pXPyp1ng2x5t-l_a39TtETb7mP4RLzCv1iXK97tXruTpvTfOMJB1hG09ElsmXi6ROrEV-3dOr-DqG4ChB3omzjFtUibtjEHdVyTk33ZGI28BlqNFspgA8i
And it causes my pages to throw an error.
Any help appreciated. I'm a real VB noob - I guess what I really need is a bit of script that replaces from ?fbclid= onwards and redirects to the proper URL?
Thanks if anyone is able to assist!
-
Oct 11th, 2021, 11:22 AM
#2
Re: Removing Facebook tags from querystring
Does the first ? in the altered url always indicate the beginning of the part you want removed?
-
Oct 11th, 2021, 12:23 PM
#3
Re: Removing Facebook tags from querystring
Originally Posted by vgolfer
Hi...I had some VB stuff written for me ages ago. All works fine. But now, when pages from this site are put on Facebook, the Facebook links always append "?fbclid=" and then a massive long string.
So my URL may from
http://www.mysite.com/thepage
to
http://www.mysite.com/thepage?fbclid...__tn__=-UK-R&c[0]=AT3udzUg6o1Ni-LiWLzfiw1-Fd5nTKf5KLk2o5SYdjfhid3LhpLD7bv7m2pXPyp1ng2x5t-l_a39TtETb7mP4RLzCv1iXK97tXruTpvTfOMJB1hG09ElsmXi6ROrEV-3dOr-DqG4ChB3omzjFtUibtjEHdVyTk33ZGI28BlqNFspgA8i
And it causes my pages to throw an error.
Any help appreciated. I'm a real VB noob - I guess what I really need is a bit of script that replaces from ?fbclid= onwards and redirects to the proper URL?
Thanks if anyone is able to assist!
What error is your application throwing?
-
Oct 11th, 2021, 05:18 PM
#4
Thread Starter
New Member
Re: Removing Facebook tags from querystring
Originally Posted by jdc2000
Does the first ? in the altered url always indicate the beginning of the part you want removed?
Yes. It always has ?fbclid= and then a long querystring of varying length.
The site uses the web.config to rewrite URL's.
So something like http://www.thesite.com/pages/content.asp?pageid=72 may get rewritten to http://www.thesite.com/page-headline. But when Facebook links it on their site, it will be http://www.thesite.com/page-headline?fbclid=.....
So the page will get redirected to a custom error page as it can't resolve the URL.
-
Oct 12th, 2021, 12:13 PM
#5
Re: Removing Facebook tags from querystring
Try something like the following:
Code:
strUrlModifier = "?fbclid="
' set strUrl to whatever data you are getting from FaceBook
strUrl = "http://www.mysite.com/thepage?fbclid...__tn__=-UK-R&c[0]=AT3udzUg6o1Ni-LiWLzfiw1-Fd5nTKf5KLk2o5SYdjfhid3LhpLD7bv7m2pXPyp1ng2x5t-l_a39TtETb7mP4RLzCv1iXK97tXruTpvTfOMJB1hG09ElsmXi6ROrEV-3dOr-DqG4ChB3omzjFtUibtjEHdVyTk33ZGI28BlqNFspgA8i"
strUrlFixed = Left$(strUrl, Instr(1, strUrl, strUrlModifier) - 1)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|