#13625: FORCE_SCRIPT_NAME bug -------------------------------------+-------------------------------------- Reporter: liangent | Owner: nobody Status: closed | Milestone: Component: Core framework | Version: SVN Resolution: worksforme | Keywords: Stage: Unreviewed | Has_patch: 0 Needs_docs: 0 | Needs_tests: 0 Needs_better_patch: 0 | -------------------------------------+-------------------------------------- Changes (by ramiro):
* status: new => closed * needs_better_patch: => 0 * resolution: => worksforme * needs_tests: => 0 * needs_docs: => 0 Comment: I can't reproduce this with the following setup: * Lighttpd (I assume it is the web server you are using because yopu don't tell us bout it and it's one that needs the use of the `FORCE_SCRIPT_NAME` setting.) * Django trunk as of now. with the following relevant configuration: '''setting.py''': {{{ ... FORCE_SCRIPT_NAME = '/path' ... }}} '''lighttpd config''': {{{ fastcgi.server = ( "/mysite.fcgi" => ( "main" => ( "socket" => "/foo/mysite.sock", "check-local" => "disable" ) ) ) alias.url = ( "/static/admin" => "/path/to/the/django/checkout/django/contrib/admin/media/", ) url.rewrite-once = ( "^(/static/admin.*)$" => "$1", "^/path(/.*)$" => "/mysite.fcgi$1", }}} When the web browser access `"/path"` the request doesn't even reach the Django realm, it is lighttpd the one that isn't finding a match for that path in its own configuration and showing its 404 page. If we add a rewrite rule for `"/path"` so it comes ''before'' the one we already have things work correctly (web browser access to both `"/path"` and `"/path/"` shows the Django view wired to the `r'^$'` expression in the main `urls.py`): {{{ url.rewrite-once = ( "^(/static/admin.*)$" => "$1", "^/path$" => "/mysite.fcgi", "^/path(/.*)$" => "/mysite.fcgi$1", ) }}} Note this ws what you've described but in the right order so the `"^/path$"` entry matches first. At this point it would be extremely helpful if you post the configuration files you are using (specially the Web server rewrite rules you describe in English). Please reopen this ticket only if you can provide these details about your setup. Also, I don't know if it is wise to to configure the web server to rewrite accesses to `"/foo/"` to something underneath that `"/foo"` (e.g. `"/path/something"` => `"/path/site.fcgi/something"`) isn't risk of recursive behavior there?. -- Ticket URL: <http://code.djangoproject.com/ticket/13625#comment:1> Django <http://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-upda...@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.