#9397: weird HttpResponseRedirect reaction to url
------------------------------------+---------------------------------------
Reporter: billychasen | Owner: nobody
Status: new | Milestone:
Component: HTTP handling | Version: 1.0
Resolution: | Keywords:
Stage: Unreviewed | Has_patch: 0
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
------------------------------------+---------------------------------------
Old description:
> 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)
New description:
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)
Comment (by mtredinnick):
(Fixed description formatting to stop my eyes watering.)
--
Ticket URL: <http://code.djangoproject.com/ticket/9397#comment:3>
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---