views:

49

answers:

2

I am looking for the most mature library, algorithm or code snippet that can generate SEO friendly and meaningful URLs from titles (e.g. www.example.org/what-is-the-most-mature-way-to-generate-seo-friendly-urls-slugs).

I know one can easily write a 10-line function that does this but I am searching for a mature library that is able to handle several edge and special cases (different languages, scripts, eastern languages like Chinese, converting special characters like '&' to 'and' and '@' to 'at' and the like, ...) and I don't want to reinvent the wheel. The resulting URLs should be as clear, clean and meaningful as possible.

The programming language doesn't matter (but it has to be open source) because I can easily port it to my preferred language.

A: 

I use django slugify filter logic for such things. Documentation for this can be found here.

It's open source and it was invented to do some simple stuff, so I'm not sure if this solution meets all of your requirements.

You should also consider(I cannot advice here to much since I'm not a SEO master) if user-friendly url is always seo-friendly. I think that striping some short words like 'and', 'at' can be better in terms of seo, because your url has more words that are meaningful keywords.

Lukasz Dziedzia
The source of slugify can be found here: http://code.djangoproject.com/svn/django/trunk/django/template/defaultfilters.py.It doesn't seem to cover all cases well.
Daniel
What do you exactly mean? you should keep in mind that urls are very limited by its nature, and also converting chinesse alphabet to ascii might ne impossible.
Lukasz Dziedzia
+1  A: 

urlify from the django javascript code also looks interesting.

Daniel