I just recently started using DropBox on Ubuntu 8.10 "Intrepid Ibex" and leftyfb in IRC pointed out to me a nifty little trick with .htaccess files. If you've been using DropBox I'm sure you've seen or made use of the Public folder and sharing files. You may have also noticed that the DropBox Public links are long and likely hard to remember when needed.
One thing that you can do, if you have your own web server, is dynamically generate these public links. For example:
Original DropBox Public URL:
DropBox Public URL with .htaccess trick:
In order to accomplish this you'll need access to a webserver and the ability to create and use a .htaccess file. On my webserver I created a folder called "dropbox" and then pasted the following into a new file, .htaccess:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ http://dl.getdropbox.com/u/012345/$1 [L,QSA]
You will need to replace the "012345″ with your unique ID. As you notice from the original link above, my unique ID is "312414″. You can find yours by copying the public link within Nautilus.
Once this is done you can share files by placing them into your DropBox Public folder and then appending the filename to your webserver URL + created folder. Again, since I created the folder "dropbox" on http://zelut.org/, my url is http://zelut.org/dropbox/. I simply append the filename I want to share and its done!
If anyone can suggest a way to present this URL with an index.html that may be a cool trick.