[thelist] Help with comparing URLs

manuel.gonzalez.noriega at gmail.com manuel.gonzalez.noriega at gmail.com
Thu Oct 6 14:00:14 CDT 2005


Hi, I've got a MySQL table of links to display GROUPED BY their href.

Trouble comes the URLs being subtly different, enough for the group
clause to fail, but still the same.

So, when I've got:

1. http://www.example.com/foo

2. http://example.com/foo

3. http://bar.example.com/foo

4. http://bar.example.com/foo/

I want them to present "as one"

I'm leaning to add a 'canonical href' column to the table and run a script that

* Replaces /http:\/\/(.*)\./ with 'http://'
* If the last character in the URL is  '/', replace it with ''

Is there any other better approach?

Thanks in advance for any hint.

--
Manuel
a veces :) a veces :(
pero siempre trabajando duro para Simplelógica: apariencia,
experiencia y comunicación en la web.
http://simplelogica.net # (+34) 985 22 12 65

¡Ah! y escribiendo en Logicola: http://logicola.simplelogica.net


More information about the thelist mailing list