diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-07-19 19:32:12 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-07-19 19:32:12 +0000 |
| commit | 99bbaa0090a605cfb80c9f1d7b1f86cb6b9e06f8 (patch) | |
| tree | 2f3b5acc1075750b798f5893abe482d0b6cc1d4e | |
| parent | b653cdcfb2558f8b3023711bd90f97192d6406fd (diff) | |
Allow avoidance of the Apache mod_rewrite undo.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7992 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/core/handlers/base.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/django/core/handlers/base.py b/django/core/handlers/base.py index b1de2831b3..c2bcad10ff 100644 --- a/django/core/handlers/base.py +++ b/django/core/handlers/base.py @@ -182,10 +182,11 @@ def get_script_name(environ): Note: this isn't used by the mod_python handler, since the equivalent of SCRIPT_NAME isn't available there. """ - # If mod_rewrite had a whack at the URL, Apache set SCRIPT_URL to - # SCRIPT_NAME before applying any rewrites. - script_url = force_unicode(environ.get('SCRIPT_URL', '')) - if script_url: - return script_url + if not environ.get('DJANGO_USE_POST_REWRITE'): + # If mod_rewrite had a whack at the URL, Apache set SCRIPT_URL to + # SCRIPT_NAME before applying any rewrites. + script_url = force_unicode(environ.get('SCRIPT_URL', '')) + if script_url: + return script_url return force_unicode(environ.get('SCRIPT_NAME', '')) |
