PHP, MySQL, Drupal, .htaccess, Robots.txt, Phponwebsites: How to force script to display as source code using .htaccess

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.
Syntax:
             RemoveHandler cgi-script .pl .cgi .php .py
             AddType text/plain .pl .cgi .php .py

Explanation:
             where,
                        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:

No comments:

Post a Comment