Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

apache: fix django rewrite rules with older httpd

httpd on FC16 (version 2.2) has a fairly old version of mod_rewrite and
per-directory rules don't work quite how I expected them to. Fix the changes
from commit a9d1f29 by moving the rewrite
rules back to global context, but specifying only the media/ bits we care about
in the django context.

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
  • Loading branch information...
commit 56346026fea97093a01e28d098b182ea6d805d61 1 parent f2c6d21
Nishanth Aravamudan authored clebergnu committed
Showing with 16 additions and 16 deletions.
  1. +16 −16 apache/conf/django-directives
View
32 apache/conf/django-directives
@@ -5,27 +5,27 @@
ERROR__DJANGO_REQUIRES_THE_PREFORK_MPM
</IfModule>
-<Location ~ "/(afe|new_tko)/server">
- #
- # Try to serve admin media files, no matter where django is actually installed
- # Covers python versions 2.4 through 2.7 and also django installed by utils/build_externals.py
- #
- RewriteEngine On
- RewriteCond /usr/local/autotest/site-packages/django/contrib/admin/media -d
- RewriteRule /media(.*) /usr/local/autotest/site-packages/django/contrib/admin/media/$1
+#
+# Try to serve admin media files, no matter where django is actually installed
+# Covers python versions 2.4 through 2.7 and also django installed by utils/build_externals.py
+#
+RewriteEngine On
+RewriteCond /usr/local/autotest/site-packages/django/contrib/admin/media -d
+RewriteRule /media/(css|img|js)(.*) /usr/local/autotest/site-packages/django/contrib/admin/media/$1/$2
- RewriteCond /usr/lib/python2.4/site-packages/django/contrib/admin/media -d
- RewriteRule /media(.*) /usr/lib/python2.4/site-packages/django/contrib/admin/media/$1
+RewriteCond /usr/lib/python2.4/site-packages/django/contrib/admin/media -d
+RewriteRule /media/(css|img|js)(.*) /usr/lib/python2.4/site-packages/django/contrib/admin/media/$1/$2
- RewriteCond /usr/lib/python2.5/site-packages/django/contrib/admin/media -d
- RewriteRule /media(.*) /usr/lib/python2.5/site-packages/django/contrib/admin/media/$1
+RewriteCond /usr/lib/python2.5/site-packages/django/contrib/admin/media -d
+RewriteRule /media/(css|img|js)(.*) /usr/lib/python2.5/site-packages/django/contrib/admin/media/$1/$2
- RewriteCond /usr/lib/python2.6/site-packages/django/contrib/admin/media -d
- RewriteRule /media(.*) /usr/lib/python2.6/site-packages/django/contrib/admin/media/$1
+RewriteCond /usr/lib/python2.6/site-packages/django/contrib/admin/media -d
+RewriteRule /media/(css|img|js)(.*) /usr/lib/python2.6/site-packages/django/contrib/admin/media/$1/$2
- RewriteCond /usr/lib/python2.7/site-packages/django/contrib/admin/media -d
- RewriteRule /media(.*) /usr/lib/python2.7/site-packages/django/contrib/admin/media/$1
+RewriteCond /usr/lib/python2.7/site-packages/django/contrib/admin/media -d
+RewriteRule /media/(css|img|js)(.*) /usr/lib/python2.7/site-packages/django/contrib/admin/media/$1/$2
+<Location ~ "/(afe|new_tko)/server">
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE frontend.settings
Please sign in to comment.
Something went wrong with that request. Please try again.