Opened 9 years ago

Closed 6 years ago

Last modified 2 years ago

#6342 closed Uncategorized (wontfix)

Option to remove 'www.' from URLs

Reported by: corporeal <corporeal@…> Owned by: nobody
Component: Core (Other) Version: master
Severity: Normal Keywords: www remove global_settings middleware common
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Considering there's a PREPEND_WWW and APPEND_SLASH, I thought it only proper there be a REMOVE_WWW option as well.

For reasons why someone would do this:

The attached patch does this in conformance with django coding standards.

Attachments (1)

patch_removewww.patch (2.3 KB) - added by corporeal <corporeal@…> 9 years ago.
Patch to add REMOVE_WWW optionA?

Download all attachments as: .zip

Change History (8)

Changed 9 years ago by corporeal <corporeal@…>

Attachment: patch_removewww.patch added

Patch to add REMOVE_WWW optionA?

comment:1 Changed 9 years ago by Simon Greenhill <dev@…>

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Triage Stage: UnreviewedDesign decision needed

comment:2 Changed 9 years ago by Malcolm Tredinnick

Resolution: wontfix
Status: newclosed

No, we've rejected this in the past. We provide a way to have consistency via the existing settings variables. If somebody doesn't want that sort of consistency, they are free to use their own middleware to make whatever changes they like, but Django isn't going to provide multiple ways to do the essentially the same thing (normalisation). The arguments at the referenced website aren't particularly strong and there's no technical or usability problem with having www in a URL.

comment:3 Changed 9 years ago by corporeal <corporeal@…>

Resolution: wontfix
Status: closedreopened

This isn't adding another way to do normalization. This is a way to do a different KIND of normalization. If you truly don't think this belongs in Django, then perhaps we should be removing the existing PREPEND_WWW?

comment:4 Changed 9 years ago by Malcolm Tredinnick

Resolution: wontfix
Status: reopenedclosed

It truly doesn't make a difference if www is consistently appended or consistently removed. The point is that the URL is normalised.

Please do not reopen this ticket.

comment:5 Changed 6 years ago by andrew.r.kelley@…

Resolution: wontfix
Status: closedreopened

I don't know how you can say "it doesn't make a difference." Clearly, people care about whether 'www' is present or not. The fine gentleman even provided a patch. Swallow your pride and make django a better framework!

comment:6 Changed 6 years ago by Łukasz Rekucki

Resolution: wontfix
Status: reopenedclosed

This has been closed by a core developer as won't fix 2 times now. Please, don't reopen tickets just because you think different. The proper way to do this, is discussing the issue on django-developers mail group.

To anyone that visits this ticket in the future: you *can* write your own middleware for this that will take about 5-6 lines. You can also do this kind of stuff in most HTTP servers (which is even better, because you don't have to hit the Django stack just to do a simple redirect).

comment:7 Changed 2 years ago by Patrick Robetson

Easy pickings: unset
Severity: Normal
Type: Uncategorized
UI/UX: unset

...and for anybody looking for this middleware like me, here's a link to get you started:

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