I have a Django app running and, along with it, I'm running a static only app on a sub path of the site (e.g. mysite.com/some-cool-path/) and I would like this sub path to be case insensitive and, ideally, take accept a number of patterns and canonically redirect to the path that I set for the static app. I tried adding a rewrite rule to the Django app's httpd.conf and it didn't seem to take. Does anyone know how I can accomplish this? asked 01 Dec '11, 14:18 chrisforrette |
The rewrite rules you should use are:
Note that the rewrite rules do not need to be inside of a Location directive in your httpd.conf. Hope that helps! answered 02 Dec '11, 16:55 seanf |
Using rewrites in httpd.conf is the correct approach.
What rewrite rule did you use?
Did you restart Apache after modifying httpd.conf?
When you say "it didn't seem to take", exactly what did you see?
Yes, I restarted after tweaking the httpd.conf. I added the following right after all of the 'LoadModule' lines:
... basically just attempting to make it case-insensitive (NC), but when I visit the path and enter any capital letters, I get a 404 from the Django application.
You need to put rewrites that are in httpd.conf within location tags.
Thanks johns! I got this to work but the case-insensitive (NC) directive doesn't seem to be working, any idea why that might be? I wrapped the code I posted above in: <location>