PHP, MySQL, Drupal, .htaccess, Robots.txt, Phponwebsites

22 Nov 2013

How to force script to display as source code using .htaccess

                       You can display script code as a source code instead of executing.
             RemoveHandler cgi-script .pl .cgi .php .py
             AddType text/plain .pl .cgi .php .py

                        RemoveHandler - remove all the server-parsed handler associated with the extensions like .pl, .php for all the paths.
                        .cgi - run outside of /cgi-bin/ directory
                        .py -  treat same as a normal HTML file
                        AddType - used to assign a MIME type to a file suffix
                        text/plain - format of file.

Related Post: