On Feb 26, 10:49 pm, Brian Neal <[email protected]> wrote:
> 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?
The answer is yes, of course.
I got it to work. I had a few problems. I think the main one was I was
just doing a "graceful" and I don't think Apache was re-reading
the .conf file to pick up my changes? When I started doing a graceful-
stop followed by a start I started seeing changes.
Also:
1. I needed a forward slash on the pattern in RewriteRule; i.e. ^/
modules.php instead of ^modules.php.
2. I needed to prevent the query string from being appended to the new
URL. This could cause recursion in some cases, or other strange things
(400 bad request). A trailing ? did the trick.
This eventually worked for me:
RewriteEngine on
RewriteCond %{QUERY_STRING} sid=([0-9]+)
RewriteRule ^/modules\.php /news/story/%1/? [R=301,L]
Nothing to do with mod_wsgi, sorry. :)
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.