Re: htaccess and mime types

2002-02-25 Thread Geoffrey Young


 I'm reading my Apache bible and the section on MIME types and my
 question is: Is there a way to modify the htaccess file so that
 regardless of the file requested (.gif, .wav, .jpg, etc.) they
 would receive a file recognizable as an html document or a plain
 text file when clicked on?

well, I'm not sure exactly what you're after, but I run this
PerlFixupHandler on a Cobalt where I don't have the ability to really
get at the phases the way I want to (through the AddHandler directive
and so on, which is probably the most proper way to do it)...

package Custom::Unscript;

use Apache::Constants qw(OK DECLINED);
use strict;

sub handler {

  my $r = shift;

  my ($extension) = $r-filename =~ m!(\.[^.]+)$!;

  # un-script a bunch of stuff
  if ($extension eq '.pl'   ||
  $extension eq '.PL'   ||
  $extension eq '.html' ||
  $extension eq '.ksh'  ||
  $extension eq '.ppm'  ||
  $extension eq '.xml'  ||
  $extension eq '.xls'  ||
  $extension eq '.rss'   ) {
$r-content_type('text/plain');
$r-handler('default-handler');
return OK;
  }

  return DECLINED;
}
1;



Re: htaccess and mime types

2002-02-24 Thread Andy Lester

 I'm reading my Apache bible and the section on MIME types and my
 question is: Is there a way to modify the htaccess file so that
 regardless of the file requested (.gif, .wav, .jpg, etc.) they
 would receive a file recognizable as an html document or a plain text
 file when clicked on?

Whyncha just have it return a 403 ?

xoxo,
Andy

-- 
%_=split/;/,.;;n;u;e;ot;t;her;c; .   #   Andy Lester
'Perl ;@; a;a;j;m;er;y;t;p;n;d;s;o;'.  #   http://petdance.com
hack;print map delete$_{$_},split//,q   [EMAIL PROTECTED]