URL shortener for Liferay

At this year's Liferay DevCon, Suraj Bihari had an interesting session about short URLs. As I was about to do something like this anyway, I decided to make it public from the beginning.

 

And now everyone can have a look at the result: Ancud ShortURL Portlet

 

Technically, it's a really simple Liferay MVC Service Builder portlet built with Ant and extended by a Servlet Filter Hook, which will do the redirection. It has some permission settings to define who may add and manage links and a basic front end, that's it.

When creating new URLs, the portlet will generate an identifier made of 10 alphanumeric characters. You can use this or override it by your own custom identifier. Then, just add the URL to be redirected to and you're ready to share! Whenever someone tries to invoke your portal with the identifier, the Servlet Filter will redirect to the destination URL. So you can build your own goo.gl/bit.ly.

 

The whole project is free of charge and totally open source, so check out how easy it works. :)

Blogs

I put a feature request for Liferay to have its own service in DXP. Link rot is the worst when it come to linking to documents. Threads are also ugly URL's and having this service allows for analytics to be gained on a user by user basis.

 

A broken destination URL can also be fixed because the short URL can be managed and edited by portal admins, thus you'd see a lot less 404.

 

Like why hasn't this been done already?  

https://issues.liferay.com/browse/LPS-112211