Shorten super long urls?
Is this url title typical of a Low Search query:
mysite.com/search/results/YTo1OntzOjg6ImtleXdvcmRzIjtzOjc6IiAgICAgICAiO3M6MTE6InNlYXJjaF9tb2RlIjtzOjM6ImFsbCI7czoxMToicmVzdWx0X3BhZ2UiO3M6MTQ6InNlYXJjaC9yZXN1bHRzIjtzOjEwOiJjb2xsZWN0aW9uIjthOjI6e2k6MDtzOjE6IjEiO2k6MTtzOjE6IjIiO31zOjQ6InNpdGUiO3M6MToiMSI7fQ
The basic expression engine one looks like this:
mysite.com/search/results/d0998fc7c6b95d0c8b6471d31c3b948e/
Is there any way to shorten mine?
Replies
Low 15 Jan 2012 10:05
Hi Eric,
Currently, there isn't. And here's why:
First of all, GET variables aren't supported by EE by default, so URLs like mysite.com/search?q=search+term is not possible.
To overcome this, the native EE search uses POST for search, saving each search query in the database, and retrieving the query by unique key, which is the 32-character long segment in your example. Down side to this is the extra query it takes to get the search query and the limit there is to a given search query (native searches are only valid for an hour or two, after which the URL will produce an error).
Low Search doesn't store its data like this, but instead encodes the complete query in the long segment above. This way there's no need for an extra DB action and the URL stays valid forever. It's not just the keywords that are encoded, but info about search collections, method, etc etc. That's why it's as long as it is.
Eric 15 Jan 2012 18:11
Alright, thanks for explaining!