How-to locally Disable Python CGI scripts.

Since the beggining of this blog, my collection of python scripts were not readable. This was due to the fact that files with .py extension are seen by the apache web server as CGI scripts. To tell apache that python files can be published as-is, put a .htaccess beside your files. Then edit it to add the following directive:

RemoveHandler .py

That’s all ! This will let apache serve .py files as normal plain text files. More info about RemoveHandler can be found in official apache documentation.

3 thoughts on “How-to locally Disable Python CGI scripts.

  1. Pingback: How to Publish .php files as Plain Text at Coolkevmen

  2. Pingback: Locally disabling Python CGI scripts « Gas station without pumps

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>