Creating SEO Friendly URLs in PHP with url_slug()

I’m talking about slugs, SEO friendly URLs, clean URLs, permalinks, etc. You know, those nice-looking URLs that are easy to read (for humans and search engines). The keywords that show up in your URLs plan an important role in how well your site ranks in search results. That’s one reason why it’s common for blogging systems like WordPress to create permalinks from post titles. I’ve had a function in my toolbox for doing this sort of thing for a while now. While working on an article management system the other day, though, I decided to take another look at it […]

Auto-Linking URLs with PHP

A week or so ago I was working on a bug in the auto-linking code for Laconica, the software that powers Indenti.ca. Squashing that particular bug wasn’t too hard, but I wanted to take the functionality a step further (closer to the calibre of Gmail) and it turns out, writing robust auto-linking code is more difficult than it initially seems. So I played with it a little at a time here and there, testing as many edge cases as I could think of. The result is a function that’s more robust than most URL auto-linking code I’ve come across. I […]