You can see smaz or shoco , which are designed to compress short strings. Most compression methods do not actually roll up to the desired URL length limit, so for this you need a specialized compressor if you expect to get any gain. You can then encode the binary result using a Base 64 type scheme or more efficient encoding that uses all secure URI characters.
source share