Avatar of Ian White
Ian White
Flag for Australia asked on

Overcome values in url parms throwing an error

Some of my dynamic Cold fusion pages with url parms have been indexed in search engines.

However the search engines have added some hex values into the query string and it
throws an error when people link back to my page as my cold fusion code is expecting url parms that cant now be found due to the extra hex characters in cgi.string
 Here is the error:

HTTP Referrer     http://us.m2.yahoo.com/w/onesearch?.lang=en&p=housesitting+in+Tampa&.tsrc=apple&submit=oneSearch&tsrc=apple&first=1
         Template          /city_house_sitter_profile.cfm
     Query String      MEM=2145548445&%253Bci=Tampa&%253Bst=Florida
     User name        
     HTML Code Format  <PRE>Element CI is undefined in URL.  &lt;br&gt;The error occurred on line 3.</PRE>

So  the search engine has added %253B - and cold fusion now cant find url.ci

How do I get around this so I can get the value of url.ci  or remove %253B
I understand cgi-query-sting is read only so cant change it?

Thanks
Scripting LanguagesWeb ServersJavaScript

Avatar of undefined
Last Comment
azadisaryev

8/22/2022 - Mon
azadisaryev

the more important question is why would %253B be added by search engines?

it should not, unless your query string originally was malformed and contained characters that had to be url-encoded but were not.

but to get around your current problem:
at the very top of your pages loop over URL collection and set new url vars without %3B in the name (see note below why it is %3B). see attached code.

NOTE: %253B decodes to %3B, which is url-encoded ; (semicolon), so the attached code replaced %3B in the url var names

Azadi
<cfloop collection="#url#" item="key">
<cfset url[replace(key, '%3B', '')] = url[key]>
</cfloop>
<cfdump var="#url#">

Open in new window

Ian White

ASKER
Hi

Thanks for your quick response.

I still had it crashing when I click direct from Yahoo even though I put the code in the
top of header of page.

If I make  up the page url from the error message and input into my browser it works ok ie:
http://www.housecarers.com/city_house_sitter_profile.cfm?MEM=2145522029&%253Bci=Tampa&%253Bst=Florida

So I am wondering why it is not working when clicking from the yahooo search engine listing at:

http://us.m2.yahoo.com/w/onesearch?_lang=en&p=housesitting+in+Tampa&_tsrc=apple&submit=oneSearch&tsrc=apple&first=1&_ym=1
ASKER CERTIFIED SOLUTION
azadisaryev

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
azadisaryev

i am sorry, but i do not believe that AveAGo's own comment was any 'solution' at all.
my comments, on the other hand, provided a fully working solution to the problem.
i believe i deserve all the points in this case.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
Ian White

ASKER
sorry I was confused by the system - I am new - I thought I gave you the points?
Ian White

ASKER
Thanks for the solution
azadisaryev

thanks, yes it is a bit confusing at times...
glad i could help you!

Azadi
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.