Total Pageviews

Monday, 19 August 2013

Use Dropbox with your own Web Domain

Your Dropbox account comes with a special “Public” folder that you may use to host documents, images, and other stuff that you want to share with everyone. To give you an example, I distribute the Always on Top utility only through my Dropbox Public folder – the file is always available for download and puts little strain on the server.
Personalized Dropbox URLs
dropbox public links
All public URLs on Dropbox follow a very standard pattern as illustrated above. The first part of the URL, which reads like dl.dropbox.com/u/ID/, is common for a Dropbox user and you can easily map it to your own domain or sub-domain.
This will make your Dropbox URLs appear less complex, you get to indirectly promote your brand since its now mentioned in the download links and, best of all, you can track individual file downloads.
How to Map Dropbox to your Web Domain
Option A. If you have a domain and a host running Apache, use the following approach:
Step 1. Go to your cPanel and setup a new sub-domain (for example, files.labnol.org). This should create a new directory with the same name on your server.
Step 2. Log in to your server and create a new file called .htaccess in the above directory. Do remember to replace XYZ with your Dropbox ID.
 
 RewriteEngine on
 RewriteRule ^(.*)$ http://dl.dropbox.com/u/XYZ/$1 [L,QSA]
 
That’s it. Now before sharing a Dropbox URL, replace dl.dropbox.com/u/ID with your web address (like files.labnol.org) and the recipients will still be able to download your files as before.
Option B. If you don’t have access to a web host, you may use Google App Engine to have custom Dropbox URLs.
Step 1: Download the source code for your new project from code.google.com and make the following changes in the code.
  • Replace XYZ in mirror.py with your Dropbox user number.
  • Replace APPNAME in appl.yaml with some unique name.
Step 2: Deploy the above project through the Google App Engine launcher. Refer to my previous Web Proxy tutorial for details on how to get started with GAE.
Step 3: This is optional. If you already have a web domain configured with Google Apps, you may serve your Dropbox redirection app on that domain else your Dropbox URLs will have structure like appname.appspot.com but without your Dropbox ID.
[*] You may use CNAME addresses to map Dropbox URLs to any sub-domain but in that case, the mapping will only happen at the root level and thus your custom URLs will still look complex – you don’t want your URLs to look like files.labnol.org/u/123/abc.txt. [**] You are only re-mapping URLs and thus the previously-stated bandwidth limits in Dropbox will still apply to all your file downloads.

from http://www.labnol.org/software/dropbox-with-custom-domain/18349/
----------------------------------------

How to Use a Custom Domain with Dropbox Public Links


using Dropbox, but suppose you wanted a better looking URL. Here’s how to accomplish that.

CNAME Record

With a CNAME (Canonical Name) DNS Record, you can have a custom domain or sub-domain point to dl.dropbox.com. All you need is your own domain name. Free sub-domains work too as long as you have access to DNS.
With this method, your URLs would look something like files.myowndomain.com/u/useridnumber/filename.extension. Since this method points your domain to Dropbox, there is no way to customize the sub-directories part.
  1. Login to your domain’s DNS control panel. This will vary depending on your domain registrar or hosting provider.
  2. Create a new CNAME entry for any hostname you choose, such as ‘dl’ or ‘files’ and have it point to dl.dropbox.com.
    Dropbox CNAME
  3. Click save and you’re done! Remember that DNS can take up to 48 hours to fully propagate.
  4. Try out your new link. Copy any Dropbox public link and replace the domain name with your own.
Dropbox Custom Domain
A simple website hosted by Dropbox. Notice the URL.
Another limitation to this method is that anyone can use your custom domain for their own Dropbox links. This carries the risk of having your domain be used to serve malicious files, resulting in it being blacklisted by various services such as Norton SafeWeb.
When someone downloads a file from you, the browser will say downloading from dl.myowndomain.com instead of dl.dropbox.com. This makes it look much more professional if you’re using Dropbox to host files.

Load in Frame

You can have the Dropbox page load in a frame on your own website domain. Simply add this line of code to your site replacing the URL part with your Dropbox public link.
1
2
3
<iframe src="http://dl.dropbox.com/u/useridhere/website/index.html" width="100%" height="100%">
  <p><a href="http://dl.dropbox.com/u/useridhere/website/index.html">Your browser does not support frames. Please click here instead.</a></p>
</iframe>
Dropbox Frame
The same webpage as above but loaded through a frame. Notice the URL.
The limitation to this method is that if its being used to serve multiple webpages, the URL bar will always show the same URL.
Of course, you can always just have a URL redirect to a Dropbox link, but that would still show the original Dropbox URL.

from http://www.techairlines.com/custom-domain-dropbox/