#!/usr/bin/perl ########################################################## # THIS SCRIPT CAN BE USED FOR SHOWING THE .htaccess FILE # ########################################################## use strict; use warnings; use feature "say"; my $fh; say 'Content-type: text/plain'; say ''; if($ENV{'QUERY_STRING'} eq 'source') { open($fh, '<', $0); print(<$fh>); close($fh); } elsif($ENV{'QUERY_STRING'} eq 'htaccess') { open($fh, "<", '../.htaccess'); print(<$fh>); close($fh); } else { say 'No valid query string was given to this script.'; say 'Try using the query string "source" to show the source code of this script'; say 'or using the query string "htaccess" to show the .htaccess file.'; } ####### # END # #######