1

I would like to setup Django with WSGI and Apache on root (/) of the website, but I would like that Apache servers through WSGI (and Django) only those URLs which do not have corresponding file to serve directly.

For PHP I would do something like this with:

RewriteCond %{REQUEST_FILENAME} !-f

and then rewrite to some index.php or something. But how to do that with WSGI?

Mitar
  • 507
  • 4
  • 18

1 Answers1

1

This is explained in the mod_wsgi documentation:

http://code.google.com/p/modwsgi/wiki/ConfigurationGuidelines#The_Apache_Alias_Directive

Don't use WSGIScriptAlias. Use AddHandler instead and use similar mod_rewrite tricks. A small fixup is required as a WSGI middleware in your WSGI script.

Graham Dumpleton
  • 5,990
  • 2
  • 20
  • 19