I am running a Django application at the root of a virtualhost using
mod_wsgi in daemon mode.

Can I use mod_rewrite to rewrite urls before they get to the wsgi
application? For example, my old site had URLs of the form:

/modules.php?name=News&file=article&sid=500

I'd like to map that to

/news/story/500/

I've played around with mod_rewrite:

RewriteEngine on
RewriteCond %{QUERY_STRING} ^name=News&file=([a-z_]+)&sid=([0-9]+)
RewriteRule ^modules\.php /news/story/%2/ [R=301,L]

But it doesn't seem to work. Even this doesn't work:

RewriteCond %{QUERY_STRING} test
RewriteRule .* /test/ [R=301,L]

which makes me think that mod_rewrite isn't even running when mod_wsgi
is in this configuration.

Is there a way to make this work?
I suppose I could try to process the old URL in my Django application
and return a redirect there.

Thanks,
BN

-- 
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.

Reply via email to