Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Allow avoidance of the Apache mod_rewrite undo.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7992 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 99bbaa0090a605cfb80c9f1d7b1f86cb6b9e06f8 1 parent b653cdc
@malcolmt malcolmt authored
Showing with 6 additions and 5 deletions.
  1. +6 −5 django/core/handlers/base.py
View
11 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', ''))
Please sign in to comment.
Something went wrong with that request. Please try again.