Deep linking to downloads
February 20, 2008 08:03 PM
| Development, Houdah
| Permalink
Looking at the download stats for HoudahGeo and HoudahSpot, I noticed that I still get a lot of downloads on long since outdated versions of both products.
I suspect this to be the effect of download sites deep linking to the ZIP files. Thus I have set up the following rewrite rules to redirect any deep link to the latest download:
From the crontab I call:
This makes sure that the "HoudahSpot latest.zip" link always points to the latest version.
I suspect this to be the effect of download sites deep linking to the ZIP files. Thus I have set up the following rewrite rules to redirect any deep link to the latest download:
RewriteCond %{HTTP_REFERER} !.*houdah.com.* [NC]
RewriteCond %{REQUEST_FILENAME} !.*latest.zip
RewriteRule .* http://www.houdah.com/houdahSpot/download_assets/HoudahSpot\ latest.zip [R]
From the crontab I call:
cd /home/houdahco/www/houdahSpot/download_assets ; ln -sf "`ls -lrt | cut -c54- | grep -v \">\" | tail -1`" HoudahSpot\ latest.zip
This makes sure that the "HoudahSpot latest.zip" link always points to the latest version.
Comments