<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel> 

	<title>Comments on: Web download tracking</title>
	<link>http://ask.metafilter.com/12388/Web-download-tracking/</link>
	<description>Comments on Ask MetaFilter post Web download tracking</description>
	<pubDate>Wed, 01 Dec 2004 17:43:10 -0800</pubDate>
	<lastBuildDate>Wed, 01 Dec 2004 17:43:10 -0800</lastBuildDate>
	<language>en-us</language>
	<docs>http://blogs.law.harvard.edu/tech/rss</docs>
	<ttl>60</ttl>

	<item>
		<title>Question: Web download tracking</title>
		<link>http://ask.metafilter.com/12388/Web-download-tracking</link>	
		<description>Web download tracking: I&apos;ve got a bunch of (totally legit etc etc) binary files available for download. I have them linked from a server I run to a server I have space on but don&apos;t run. (The html is on my own server, the binaries are on the other one.) I want to track downloads of the binaries, but I can&apos;t get at the access logs for their server. What can I do on my server to track &apos;click throughs&apos; from the html page to the binaries? I&apos;d like it to be completely transparent to the client: they can wget, right click download etc etc but I just want to know when they initiate a connection to download from the binaries&apos; server. &lt;br /&gt;&lt;br /&gt; The kind of thing I&apos;m looking for is a way to have apache log the request locally first and then rewrite the URI to point to the other server and redirect it immediately. I can change apache on my server to my bidding, any ideas?</description>
		<guid isPermaLink="false">post:ask.metafilter.com,2004:site.12388</guid>
		<pubDate>Wed, 01 Dec 2004 17:22:32 -0800</pubDate>
		<dc:creator>neustile</dc:creator>
		
			<category>apache</category>
		
			<category>httpd</category>
		
			<category>logs</category>
		
	</item> <item>
		<title>By: smackfu</title>
		<link>http://ask.metafilter.com/12388/Web-download-tracking#215559</link>	
		<description>The best way to do it is with a &lt;a href=&quot;http://httpd.apache.org/docs/mod/mod_alias.html#redirect&quot;&gt;Redirect&lt;/a&gt; in Apache.  The urls will indicate your site but will instantly switch to the other site when clicked or fetched.  And they will show up in your access logs as a 301 or 302 return code (rather than a normal 200 one).  &lt;br&gt;
&lt;br&gt;
The redirect line looks like this and goes in the .htaccess file:&lt;br&gt;
&lt;br&gt;
Redirect permanent / http://www.example.com/&lt;br&gt;
&lt;br&gt;
Change the paths as needed.  Since the files were never on this server, just create a new directory that you&apos;ll pretend they&apos;re in, and then put the .htaccess file in there.  You can then use relative links to the files in that directory.  Replace the full example URL with the full path to the matching directory on the other server.&lt;br&gt;
&lt;br&gt;
(I only know this because I do it on my site to put some of my photos on another server that has more space.  &lt;a href=&quot;http://www.smackfu.com/photos/greece/day-2/DSCF1064.JPG&quot;&gt;Example&lt;/a&gt; -- check the URL before you click.)</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2004:site.12388-215559</guid>
		<pubDate>Wed, 01 Dec 2004 17:43:10 -0800</pubDate>
		<dc:creator>smackfu</dc:creator>
	</item><item>
		<title>By: zelphi</title>
		<link>http://ask.metafilter.com/12388/Web-download-tracking#215560</link>	
		<description>If you have PHP support, you can do something like &lt;br&gt;
&lt;br&gt;
&amp;lt;?php&lt;br&gt;
    header(&quot;HTTP/1.1 302 Moved Temporarily&quot;);&lt;br&gt;
    header(&quot;Location: http://www.otherserver.com/file.exe&quot;);&lt;br&gt;
    header(&quot;Connection: close&quot;); &lt;br&gt;
?&amp;gt;</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2004:site.12388-215560</guid>
		<pubDate>Wed, 01 Dec 2004 17:44:15 -0800</pubDate>
		<dc:creator>zelphi</dc:creator>
	</item><item>
		<title>By: neustile</title>
		<link>http://ask.metafilter.com/12388/Web-download-tracking#215577</link>	
		<description>smackfu, that is a great and awesome answer that worked perfectly! And here I was looking up how to use mod_rewrite. I thank you many, many times.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2004:site.12388-215577</guid>
		<pubDate>Wed, 01 Dec 2004 18:18:37 -0800</pubDate>
		<dc:creator>neustile</dc:creator>
	</item><item>
		<title>By: yerfatma</title>
		<link>http://ask.metafilter.com/12388/Web-download-tracking#215587</link>	
		<description>Hmm, that&apos;s way neater, but if you wanted anything more robust, you can just put all the binaries in a folder (or folders), capture all requests to that folder with mod_rewrite, send them to a page that transparently bounces them to their request (which you allow through a rewrite condition) after logging whatever info you like.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2004:site.12388-215587</guid>
		<pubDate>Wed, 01 Dec 2004 18:37:52 -0800</pubDate>
		<dc:creator>yerfatma</dc:creator>
	</item><item>
		<title>By: JeffL</title>
		<link>http://ask.metafilter.com/12388/Web-download-tracking#215590</link>	
		<description>I&apos;m interested in doing the same sort of thing, but I&apos;m using IIS with ASP (for a variety of reasons, I&apos;m stuck with Microsoft stuff at this point...)&lt;br&gt;
&lt;br&gt;
Any suggestions?</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2004:site.12388-215590</guid>
		<pubDate>Wed, 01 Dec 2004 18:49:49 -0800</pubDate>
		<dc:creator>JeffL</dc:creator>
	</item><item>
		<title>By: smackfu</title>
		<link>http://ask.metafilter.com/12388/Web-download-tracking#215626</link>	
		<description>It&apos;s actually easier in IIS.  Go into the management tool for IIS, and choose to create a new virtual directory under your desired web site.  Give it the directory name you want, and point it at any of your local directories for now (it doesn&apos;t matter where).  Then open the properties on the virtual directory you create, choose the Virtual Directory tab, and choose the option for &quot;A redirection to a URL&quot;.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2004:site.12388-215626</guid>
		<pubDate>Wed, 01 Dec 2004 20:53:22 -0800</pubDate>
		<dc:creator>smackfu</dc:creator>
	</item>
	</channel>
</rss>
