2009/12/4 Daenney <[email protected]>: > Perhaps this has been documented somewhere before and in that case I > apologise for not being able to find the solution. > > My problem is the following: > > I have a django-app named Amelie running in /data/apps/amelie and an > apache httpd running for my domain with a doc-root of /data/htdocs > > The application is mounted on / which means wsgi "steals" all the URL > requests and handles them but I only want wsgi to come in play when > the requested URL doesn't physically exist in the doc-root. > > An example of the behavior I'm trying to accomplish. > > When the following URL is requested: > www.example.com/teletubies > And /data/htdocs/teletubies exists then just serve the content of that > directory, else give the request to wsgi and hence the django-app > because it might know what to do with it or will throw a 404 instead. > > Anyone got a clue as how to do this?
Short on time so very quickly, go read: http://code.google.com/p/modwsgi/wiki/ConfigurationGuidelines#The_Apache_Alias_Directive In short, remove the WSGIScriptAlias you have. Put the WSGI script in document root and call it 'site.wsgi'. Make sure not using __file__ as reference anchor in WSGI script file and instead make paths absolute instead. Make the SCRIPT_NAME fix up as described in that document using WSGI application wrapper. In Directory directive for DocumentRoot, then add: AddHandler wsgi-script .wsgi RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ /site.wsgi/$1 [QSA,PT,L] Read that document for more information. That configuration is towards the end of that section. In mod_wsgi 4.0 there will likely be a way of doing this which doesn't need mod_rewrite. If don't understand tell me which bit and will give better explanation where necessary. Graham -- You received this message because you are subscribed to the Google Groups "modwsgi" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en.
