Htaccess FCGI handler

I am trying to configure django on a hosting provider. I followed the instructions http://helpdesk.bluehost.com/index.php/kb/article/000531 and it almost works.

The problem I'm currently facing is that the traffic is routed correctly through the fcgi file, but the file itself is displayed as plain text in the browser. If I run. /mysite.fcgi in the ssh shell, I get the default django welcome page.

my.htaccess:

AddHandler fastcgi-script .fcgi RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ mysite.fcgi/$1 [QSA,L] 

and mysite.fcgi:

 #!/usr/bin/python2.6 import sys, os os.environ['DJANGO_SETTINGS_MODULE'] = "icm.settings" from django.core.servers.fastcgi import runfastcgi runfastcgi(method="threaded", daemonize="false") 

thanks.

+4
source share
1 answer

Try removing AddHandler or change it to:

 AddHandler fcgid-script .fcgi 
+8
source

Source: https://habr.com/ru/post/1306611/


All Articles