Jon Simpson

Cleaner URLs for Dropbox Public Files

21 May 2013 — dropbox, htaccess

The dl.dropboxusercontent.com URLs generated by the Dropbox public folder are quite long and not particularly friendly. Inspired by Matt Henderson’s subdomain redirect approach, some .htaccess magic can allow a path on another site to redirect all requests within it to the Dropbox public folder - just insert your Dropbox user ID in place of 123123 (you can find it after the /u/ in the public links Dropbox generates for you)

RewriteEngine On
RewriteBase /
RewriteRule ^db/(.*)  https://dl.dropboxusercontent.com/u/123123/$1 [R=301,L]

The above rewrite rule means that requests for any file under http://example.com/db/ will redirect, complete with filename to https://dl.dropboxusercontent.com/u/123123/ - making it easy to provide a clean link to anything in your public folder.


 Home