What is the best way to truncate a URL when displaying it within a web page? I don't mean a link but literally displaying the URL as a value to the user, assuming that the text might be in a container of fixed width and you don't want to wrap or run outside of the container?
Is it better to truncate from the end, favouring the early part of the url:
eg. http/really.long/urlthaticantf...ere.html
Or place the '...' in the middle to favour the start and end of the link as the most value in terms of giving context:
eg. http/really.long/ur...aticantfithere.html
Also what is a good rule of thumb when choosing how long to make the truncated url? Should you be pessimistic and pick a likely wide character such as capital 'M' and see how many of these fit in the layout? This tends to give really short URLs in general as most characters are much narrower than 'M'.
Or should you be optimistic and use a truncation that generally gives a good length but risk overrunning when the URL contains many large characters?