I have a Django (WSGI) application running under a subdirectory. The FORCE_SCRIPT_NAME is set to the directory name in settings.py:
The location hour is aliased to my Django application in httpd.conf:
The URL http://mydomain.com/hour/ works correctly. But the URL without the trailing slash (http://mydomain.com/hour) is problematic: It looks like the working directory of my scripts becomes one directory higher, and the relative paths in my template files do not work anymore.
I believe the solution should be in the Apache Rewrite rules because I cannot distinguish between the two URLs (with or without trailing slash) in Django in urls.py.
Can anyone help?
asked Feb 12 '11 at 13:25
This series of rules will automatically redirect domains without a tailing slash to domains with a tailing slash,
You may have to adjust them slightly to work for your django app. They should be placed within the httpd.conf file.