If you want to try it out, I have pushed up new feature to allow rewrite rules.
Currently on develop branch of mod_wsgi Git repo.
The rewrite rules can be placed in the rewrite.conf file in the server root directory.
Better still, use the —rewrite-rules option to specify the location of your own file containing the rewrite rules.
For example:
$ mod_wsgi-express start-server tests/envirowsgi --rewrite-rules rewrite.conf --log-level 'info rewrite:trace8' --log-to-terminal
Server Root : /tmp/mod_wsgi-localhost:8000:502
Server Conf : /tmp/mod_wsgi-localhost:8000:502/httpd.conf
Error Log File : /dev/stderr (info rewrite:trace8)
Rewrite Rules : /Users/graham/Projects/mod_wsgi/rewrite.conf
Request Capacity : 5 (1 process * 5 threads)
Request Timeout : 60 (seconds)
Queue Backlog : 100 (connections)
Queue Timeout : 45 (seconds)
Server Capacity : 20 (event/worker), 20 (prefork)
Server Backlog : 500 (connections)
Locale Setting : en_AU.UTF-8
You don’t need a RewriteEngine On directive.
Just include your RewriteCond/RewriteRule directives.
Avoid using RewriteBase as may well screw up what mod_wsgi rules do and not sure it is needed anyway in that context.
The rules should be applied before static file matching, so can also be used to remap static files as well.
A really simple example of a rewrite.conf file would be:
RewriteRule ^/?$ /blah [R=301]
This would cause access to root of site using just ‘/‘ to be redirected to ‘/blah’. Everything else should flow through as normal.
If you find any issues or have problems constructing the rules you want then let me know.
Graham