This extension is designed for the Content Management System eZPublish. Its aim is to provide a simple system that will allow users to get short urls of an article, a folder, a video or any content.
A key of 4 characters is generated at the publication time and added into the URL. As it's unique for a node ID, it can match Google News requirements (limited to first version). For ex :
http://my.domain.com/Solutions/Web-publishing/Bastille
Turned in :
http://my.domain.com/Solutions/Web-publishing/Bastille-004v
http://my.domain.com/us/view/004v
Redirect to :
http://my.domain.com/Solutions/Web-publishing/Bastille-004v
This extension has been tested under eZPublish 4.4. As it used standard apis of eZPublish, there's no other requirement to make it work.
If you want to use this extension correctly, we recommand to enable the Apache rewrite module and enable it in the configuration.
The installation follows thoses steps :
$ php bin/php/ezpgenerateautoloads.php -e wse_us
$ php bin/php/ezcache.php --clear-all --purge
You can set up the content typ on which this extension will apply in the block "AppendShortURLFilterSettings" of the site.ini of the extension (or do an override, it's cleaner). The setting "ApplyOnClass" is an array containing the string identifiers of the concerned classes.
To insure that URL will be the shorter, the most common things to do are the following :
http://www.domain.com ==> http://s.domain.com
RewriteCond %{QUERY_STRING} ^([a-zA-Z0-9]{4})$
RewriteRule ^/$ /us/view/%1? [R=301,L]
It's very easy, you just have to include the short_url template and provide a node id.
Example :
{include uri="design:us/short_url.tpl" node_id=$node.node_id}
If you have some trouble with this extension, contact us at wascou.org.
The license is 