Forum Moderators: phranque

Message Too Old, No Replies

Encoding Problem with a Colon

Can't find a way to rewrite this

         

Musicarl

12:29 pm on Jul 21, 2011 (gmt 0)

10+ Year Member



Google is seeing these as separate pages:

http://example.com/item:something.php
http://example.com/item%3Asomething.php

That pesky colon is the problem. In the browser url we see %3A, but
apache mod_rewrite automatically decodes it and sees it as ":" Since apache doesn't see the offending characters, we don't know how to use it here.

Any ideas on how to fix this?

mhansen

12:53 pm on Jul 21, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I do not have an answer for you... I just wanted to subscribe to the thread, so I can keep an eye on the Angry Colon jokes. My wife has IBS, and I could use some more jokes...

MH

g1smd

4:16 pm on Jul 21, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Only certain characters are valid in the path part of a URL, and it's a slightly different list for what's valid in an appended query string.

All other characters MUST be encoded. That's detailed in the core HTTP specifications. Choose a different separator for use in your URLs.

Musicarl

12:24 pm on Jul 22, 2011 (gmt 0)

10+ Year Member



So it sounds like we need a colonoscopy (that was for you, mhansen).

We used the colon because Wikipedia does, but it looks like they have the same problem as well - replace the : with %3A on any of their category pages and the same thing happens.

It's starting to sound like the solution is either use a different separator (thank you g1smd) or don't worry about it.

g1smd

4:28 pm on Jul 22, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



MediaWiki has many issues, this being just one of them.

Use a different separator.

An unencoded colon is not a valid character in the path part of a URL or in the appended query string data.

It can only be used in http: protocol part and in :80 port number part.