Opened 10 years ago

Closed 9 years ago

#9397 closed (invalid)

weird HttpResponseRedirect reaction to url

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: UI/UX:

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 that redirects via HttpResponseRedirect(reverse('mysite.index.views.hello'))

If I am at -- it correctly goes to

If I am at (no www) -- it redirects to

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 (4)

comment:1 Changed 10 years ago by billychasen

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

comment:2 Changed 10 years ago by Chris Beaven

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 ( runserver 0:8000), what happens when you go to ?

comment:3 Changed 10 years ago by Malcolm Tredinnick

Description: modified (diff)

(Fixed description formatting to stop my eyes watering.)

comment:4 Changed 9 years ago by Chris Beaven

Resolution: invalid
Status: newclosed

3 months with no response from the reporter. Closing - but if anyone has the same problem, feel free to reopen.

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