I am trying to deploy a django project under a sub-URL on hostgator hosting. Here is the tutorial I was following: http://support.hostgator.com/articles/django-with-fastcgi
My index.fcgi looks like this:
#!/usr/bin/python2.7
import sys, os
sys.path.insert(0, "/home/my_project_dir")
sys.path.insert(0, "/home/my_project_dir/my_project/")
os.chdir("/home/my_project_dir/my_project/")
os.environ['DJANGO_SETTINGS_MODULE'] = "my_project.settings"
from django.core.servers.fastcgi import runfastcgi
runfastcgi(method="threaded", daemonize="false")
And the .htaccess looks like this:
AddHandler fcgid-script .fcgi
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.fcgi/$1 [QSA,L]
Both of these files placed in a sub-direcotry /home/my_project_dir/public_html/dir/sub/
Problem is that when I try to access www.mydomain.com/dir/sub/ I get a 404 Resource not found error.