Can't download simple .py files


#1

I have uploaded several Python scripts that are intended to be downloadable as plain-text files. To avoid forcing users to rename them after saving, it is important that they be served as-is with the URL ending in .py, rather than .txt.

Since Apache is apparently set to attempt to interpret .py scripts implicitly, I tried to disable this in the downloads folder by creating an .htaccess file with an “AddType text/plain .py” directive. However, Apache still attempts to execute the script.

The result is an error log message along the lines of “suexec policy violation: see suexec log for more details, referer: …”


#2

Apache generally decides what to do with a file based on handlers, not MIME type. So:


#3

Thank you, this worked perfectly.