1

what is the rule for htaccess that makes all files text ?

like .php .py .pl whatever will be no different than .txt, source code should appear on the screen without execution.

thx.

Devrim
  • 1,187
  • 4
  • 16
  • 29

2 Answers2

3

ForceType text/plain

http://httpd.apache.org/docs/2.2/mod/core.html#forcetype

Jeff Snider
  • 3,272
  • 18
  • 17
1

Create a rule in an .htaccess file in whatever directory you want to house your code examples. The .htaccess file should have this in it:

AddType application/x-httpd-php-source php

That's it. You'll get nice color coding. Jeff's answer works well for all file types.

Patrick R
  • 2,945
  • 1
  • 19
  • 27