I have following .htaccess file -
AddHandler fcgid-script .fcgi
DirectoryIndex index.fcgi
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.fcgi$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.fcgi/$1 [L]
</IfModule>
and following index.fcgi file:
#!/home/username/mydjango/bin/python
import os
import sys
from flup.server.fcgi import WSGIServer
from django.core.wsgi import get_wsgi_application
sys.path.insert(0, "/home/username/mydjango")
os.environ['DJANGO_SETTINGS_MODULE'] = "testproject.settings"
WSGIServer(get_wsgi_application()).run()
The Django app runs successfully but inserts 'index.fcgi' in the URL like this-
www.example.com/index.fcgi/admin instead of www.example.com/admin
How can I strip the script name from the URL ?
I tried following the instructions here - http://flask.pocoo.org/docs/0.10/deploying/fastcgi/
But it is for flask and I can't get it running for Django.
P.S - I am on a shared hosting plan with no root access of the server.