I have a problem similar to this question - I'm restricted to using 1and1 hosting, running cgi through virtualenv.
I have the following in my .htaccess file:
Options +ExecCGI
DirectoryIndex index.cgi
RewriteEngine On
RewriteRule ^/mypath/test/index.cgi/(.*)$ - [S=1]
RewriteRule ^/mypath/test/(.*)$ /mypath/test/index.cgi/$1 [QSA,L]
My index.cgi contains
#!/path/to/myenv/bin/python
from wsgiref.handlers import CGIHandler
from flask import Flask
app = Flask(__name__)
@app.route("/", defaults={"path":''})
@app.route("/<path:path>")
def main(path):
return "oh hai, mr. %s" % path
@app.route("/fnord")
def fnord():
return "allo"
CGIHandler().run(app)
What I would like to be able to do is go to www.mysite.com/mypath/test/page-one and www.mysite.com/mypath/test/page-two. But right now all I can do is go to index.cgi or index.cgi/fnord. I can also go to /test/. What do I need to do to fix this?