Create your own short URLs with K2 & sh404sef

Recently, one of the very usefull features of sh404sef, automatic short URLs, started supporting K2 content… Here’s how to enable it.

What are shURL?

You’ve all seen short links on Twitter or in forums.  These short and cryptic URLs that, when clicked on, bring you to a page with a much larger URL.  There are many services like bit.ly or goo.gl that will take your own URLs and make them look like bit.ly/342ff5 or goo.gl/55h38 but if you are lucky enough to have a short domain name (or just have really long URLs) then shURL will definitely simplify things for you!

Example

This page’s normal URL is http://www.yanaku.com/k2/create-your-own-short-urls-with-k2-sh404sef but with shURL on, this page’s URL is also http://www.yanaku.com/3f or even better: http://yanaku.com/3f

How do I enable it?

First thing you need is a version of sh404sef that supports shURL.  Get the latest but anything starting at build 2.2.4.955 will do.

Then you’ll need to go to Components -> sh404SEF, click on the “configuration” tab then select “sh404SEF Configuration”.

You should see 6 tabs, the second one named “shURL”, select it.

shURL_main

Click yes for “Enable shURL” but wait! that’s not all

Now go to the “By Component” tab

shURL_bycomponent

Then in the big list, find the row for “K2″ and in the last drop down, select “Enable shURL”.  That will make sure that any K2 items created do actually generate short URLs. Save your changes.

shURL_enablecomponent

 

But wait, there’s more!

Like most major options in sh404sef, when you make changes, you’ll need to purge your current URLs and regenerate them… This can sometimes be a little scary and I’ll cover that in another blog post, but if you’ve done it before and know the procedure, then head on over to your “URL Manager” and click the purge button (you made backups right?) and then regenerate your sitemap.

sh404_purgeURL

 

and then there was… short URLs

Once all these steps are completed, all your site URLs now have short URLs assigned to them :-) Visit your shURL manager to see them in all their glory.

shURL_new_URL

 

As usual, feel free to comment below! Cheers. 

Update (May 12th 2011)

Someone asked me how to refer to this shURL on your page.  It took me a while to find this out (I actually got to talk to Yannick the main dev at Joomla & Beyond) and here’s the answer: just use [sh404sef_shurl] - replace the [] by {} brackets - and the shURL will be displayed in your article/item content.