I wrote this blog entry about this here:
Below is the summary:
I started using ; as a delimiter for query strings instead of & for the following reasons:
* The W3C HTML validator doesn't like having a & by itself for HTML 4.01
* YaBB Forum uses a ; which is where I got the idea to begin with
* The Perl CGI module supports it just as well as with &
* Writing out "&" with each link in place of a simply "&" is ugly.
I hadn't had any problem with it, but I recently discovered that Google messes it up. When linking to a page that used ; as a delimiter, the ; is URI encoded as %3B, which in turn confuses CGI.pm because it's looking for either a ; or an & to separate query string parameters, and therefore might think there's only one parameter with a very long value (the entire remainder of the query string)... etc.
My back-end HTML templates didn't properly write links out in the first place, instead writing them like
and the Perl would dynamically rewrite that as a proper link before it's presented to the user (this way I could easily switch to a mod_rewrite approach or other page naming scheme in the future without having to modify all of my pages). So it was trivial to adjust it to use a full proper "&" format for the links...
And then for the existing broken Google links, I added a hack to check for the URI-escaped %3B in the query string, replace those with literal ;'s and send an HTTP 301 redirect to the proper location.
I'm curious as to how other web developers tackle this solution? Do you just write "&" inside all the links, or do you use a Perl or PHP "front" like me that fixes your laziness before the browser gets it?
Cuvou.com | My personal homepage
Below is the summary:
I started using ; as a delimiter for query strings instead of & for the following reasons:
* The W3C HTML validator doesn't like having a & by itself for HTML 4.01
* YaBB Forum uses a ; which is where I got the idea to begin with
* The Perl CGI module supports it just as well as with &
* Writing out "&" with each link in place of a simply "&" is ugly.
Code:
How the HTML Validator highlights the error:
<a href="/?p=blog[red]&i[/red]d=36">
I hadn't had any problem with it, but I recently discovered that Google messes it up. When linking to a page that used ; as a delimiter, the ; is URI encoded as %3B, which in turn confuses CGI.pm because it's looking for either a ; or an & to separate query string parameters, and therefore might think there's only one parameter with a very long value (the entire remainder of the query string)... etc.
My back-end HTML templates didn't properly write links out in the first place, instead writing them like
Code:
<a href="$link:blog;id=36">
and the Perl would dynamically rewrite that as a proper link before it's presented to the user (this way I could easily switch to a mod_rewrite approach or other page naming scheme in the future without having to modify all of my pages). So it was trivial to adjust it to use a full proper "&" format for the links...
Code:
<a href="/?p=blog&id=36">
And then for the existing broken Google links, I added a hack to check for the URI-escaped %3B in the query string, replace those with literal ;'s and send an HTTP 301 redirect to the proper location.
I'm curious as to how other web developers tackle this solution? Do you just write "&" inside all the links, or do you use a Perl or PHP "front" like me that fixes your laziness before the browser gets it?
Cuvou.com | My personal homepage
Code:
perl -e '$|=$i=1;print" oo\n<|>\n_|_";x:sleep$|;print"\b",$i++%2?"/":"_";goto x;'