I’m using apache2 and enabled a site that has no index.html file in its <Directory> directive, so an index of all the files is displayed instead of an html webpage.
I’ve included some .php files that I want to allow other people to download, however whenever I download a .php file from this page, it is already ‘interpreted’.
For example if I save hello.php onto my desktop
<? php $var = 'hello world'; echo $var ?>
When I open up hello.php the code reads
hello
Is there any way I can allow people to download the code before it is interpreted?
Depending on the server configuration you need a
.htaccesswith:Or:
Or:
And sometimes even a brute-force method: