Opened 8 years ago

Closed 5 years ago

Last modified 12 months 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

Description

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: http://no-www.org/

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

Attachments (1)

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

Download all attachments as: .zip

Change History (8)

Changed 8 years ago by corporeal <corporeal@…>

Patch to add REMOVE_WWW optionA?

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

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design decision needed

comment:2 Changed 8 years ago by mtredinnick

  • Resolution set to wontfix
  • Status changed from new to closed

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 8 years ago by corporeal <corporeal@…>

  • Resolution wontfix deleted
  • Status changed from closed to reopened

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 8 years ago by mtredinnick

  • Resolution set to wontfix
  • Status changed from reopened to closed

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 5 years ago by andrew.r.kelley@…

  • Resolution wontfix deleted
  • Status changed from closed to reopened

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 5 years ago by lrekucki

  • Resolution set to wontfix
  • Status changed from reopened to closed

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 12 months ago by pjrobertson

  • Easy pickings unset
  • Severity set to Normal
  • Type set to Uncategorized
  • UI/UX unset

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

http://dryan.me/articles/remove-www-urls-django/

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