Opened 16 years ago

Last modified 16 years ago

#9397 closed

weird HttpResponseRedirect reaction to url — at Version 3

Reported by: billychasen Owned by: nobody
Component: HTTP handling Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Malcolm Tredinnick)

If I have a url defined, such as:

(r'^hello$', 'mysite.index.views.hello')

and let's say I have a page on http://mysite.net that redirects via HttpResponseRedirect(reverse('mysite.index.views.hello'))

If I am at http://www.mysite.net -- it correctly goes to http://www.mysites.net/hello

If I am at http://mysite.net (no www) -- it redirects to http://mysite.net/.net/hello

It's easily fixed by changing the url definition to

(r'^hello/$', 'mysite.index.views.hello')

(adding a trailing forward slash)

Seems to me though, that this shouldn't be required (seems a little buggy and took awhile to track down)

Change History (3)

comment:1 by billychasen, 16 years ago

I mistyped on the regex -- please ignore the $ (dollar sign) on the end

comment:2 by Chris Beaven, 16 years ago

Component: UncategorizedHTTP handling

A slash shouldn't be required.

But we'll need some more information to track the problem down - in fact, it sounds like it could be a web server mis-configuration rather than something which is happening in Django. If you run the local web server on your server (manage.py runserver 0:8000), what happens when you go to http://mysite.net:8000 ?

comment:3 by Malcolm Tredinnick, 16 years ago

Description: modified (diff)

(Fixed description formatting to stop my eyes watering.)

Note: See TracTickets for help on using tickets.
Back to Top