AddType text/html pyAddHandler cgi-script .py
In the same .htaccess file, this Apache script hides ".py" extensions:
RewriteEngine onRewriteCond %{REQUEST_FILENAME} !-dRewriteCond %{REQUEST_FILENAME}\.py -fRewriteRule ^(.*)$ $1.py
For your script example.com/filename.py, you can type example.com/filename or example.com/filename.py
Python path:
#!/usr/bin/pythonprint "Content-type: text/html\n\n";print "";print "CGI Test ";print "
print "Test page using Python
";
";
print "
";
No comments :
Post a Comment