[thelist] IIS/http_referer/CF redirect

.jeff jeff at members.evolt.org
Mon Dec 23 21:11:01 CST 2002


erik,

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> From: Erik Mattheis
>
> If someone clicks a link on site B to a MP3 residing on
> site A, instead of getting the file, they get a HTML
> page preaching about how evil the owners of site B are.
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

hmmm, there might be an easy solution.

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> Running it through a 404 handler would be a solution -
> but then I'd have to search and replace all the content
> where my client links to those files ... what would the
> SQL be to do this (SQL Server 7)? SELECT INTO? How
> would I search and replace the string (the content is
> in all varchar fields).
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

for now, i'd leave the links in the database content alone.

but this is going to be the best solution.  causing it to happen will be
another matter though.

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> Another idea ... What happens if I change IIS .mp3 is
> run through ColdFusion?
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

bad idea.  you'd be unnecessarily processing binary files with an engine
never designed to parse them.  additionally, it's not likely you'd be able
to serve genuine mp3 content to the user as a result of this.

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> What happens if I use <cfcontent> to serve the files I
> want to be served?
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

another bad idea.  <cfcontent> is a resource intensive tag.  it should only
be used in those situations where the file you want to send the website
visitor is outside the webroot (and placed there on purpose for a very good
reason).

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> Here is the problem - my client's site:
> <http://aprilwinchell.com/multimedia/>.
> Someone else's site:
> <http://www.youngelder.com/multimedia.htm> (content
> ripped off a few weeks ago when the content was
> different)
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

just move the mp3 files to another path -- /multimedia/mp3/foo.mp3 -- rather
than the one you have -- /multimedia/media/mp3/foo.mp3.

then, setup the /multimedia/media/mp3/ directory with a custom 404 error
handler.  point it at /multimedia/media/mp3/index.cfm as the url to handle
the request.  do a simple check to see if there's a referer.  if there is
and it's the thieving site serve up your message to visitors of the
bandwidth thieving site.  otherwise, simply do a cflocation to the new path.

good luck,

.jeff

http://evolt.org/
jeff at members.evolt.org
http://members.evolt.org/jeff/




More information about the thelist mailing list