wxMichael Posted January 21, 2011 Share Posted January 21, 2011 When I upload .py files to my website to show the source to other people, I get an error when I go to the URL. I guess the server is trying to execute the pyton files instead of just displaying their contents as plain text. Is there a way to make them display as plain text, possibly with .htaccess? (I'm using GoDaddy for hosting, if that's of any importance.) Link to comment Share on other sites More sharing options...
0 mikeaag Posted January 21, 2011 Share Posted January 21, 2011 When I upload .py files to my website to show the source to other people, I get an error when I go to the URL. I guess the server is trying to execute the pyton files instead of just displaying their contents as plain text. Is there a way to make them display as plain text, possibly with .htaccess? (I'm using GoDaddy for hosting, if that's of any importance.) could you not just change the file extension? im not really sure how python files work, but if you uploaded your file with .txt extension instead, would that not do the trick? Link to comment Share on other sites More sharing options...
0 wxMichael Posted January 21, 2011 Author Share Posted January 21, 2011 It does work like that, but I was hoping for a better solution. Link to comment Share on other sites More sharing options...
0 Xilo Posted January 21, 2011 Share Posted January 21, 2011 Make a .htaccess in the folder where your python files are. Then put this in the .htaccess: RemoveHandler .py Link to comment Share on other sites More sharing options...
0 wxMichael Posted January 21, 2011 Author Share Posted January 21, 2011 Make a .htaccess in the folder where you're python files are. Then put this in the .htaccess: RemoveHandler .py Thanks, that works perfectly :D Link to comment Share on other sites More sharing options...
Question
wxMichael
When I upload .py files to my website to show the source to other people, I get an error when I go to the URL.
I guess the server is trying to execute the pyton files instead of just displaying their contents as plain text.
Is there a way to make them display as plain text, possibly with .htaccess?
(I'm using GoDaddy for hosting, if that's of any importance.)
Link to comment
Share on other sites
4 answers to this question
Recommended Posts