Closed (duplicate)
Project:
Domain
Version:
6.x-1.2
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
10 Sep 2008 at 14:11 UTC
Updated:
4 Oct 2009 at 17:31 UTC
My primary domain name is "www.verkehrswende.net".
Secondary domain names are of the model "hamburg.verkehrswende.net" or "berlin.verkehrswende.net".
Now, if I switch on WWW prefix handling (to treat www.*.verkehrswende.net as an alias of *.verkehrswende.net), I run into a circular redirect which breaks the whole site. Obviously, "www.verkehrswende.net" is rewritten to "verkehrswende.net", which is rewritten to "www.verkehrswende.net" and so on...
What should happen instead? The active domain should first be checked against the domain table (including the primary domain). Only if it is not listed with the "www." prefix, the "www." prefix should be stripped.
Comments
Comment #1
agentrickardNo. That is not the design.
www.* is the abberation here. The RFC for domain names does not specify its use. example.com is preferred to www.example.com.
Either turn off the www prefixing option, solve that at the server level, or change your primary domain to verkehrswende.net.
Comment #2
panchoThis can't or shouldn't be by design for two reasons:
Please reconsider this.
If you really insist on this bug being "by design", then we at least need to rule out configurations leading to a circular redirect, by fixing the field description and/or adding a validation check. Then the rest of this issue wouldn't be a bug anymore, but rather a feature request.
Comment #3
agentrickardLet's fix the field description then.
The module is not intended to be used by naive users who cannot self-correct this sort of problem.
There was a larg debate about a similar issue, where I basically said -- "If your webserver is configured that www.* is the default, then it is misconfigured, and I cannot help you." I stick by that.
The 'by design' part that you are fighting is a silent correction to user misbehavior. If you configure www-prefix aliasing and set your default domain correctly, users will be silently sent to the proper host. That part is deliberate and not up for debate.
Comment #4
agentrickardWe should also have a documentation patch for section 4.1.1 of the README.txt
Comment #5
agentrickardComment #6
nonsieI have to agree with Pancho on this because if you set your default domain to use www, turn off www prefixing and solve www.example.com vs example.com at the server level you will get a message saying you have followed an incorrect link when visiting example.com.
Instead I'd prefer to set up default domain as example.com and use www prefxing however all URLs get rewritten to use example.com instead of www.example.com once user has followed a link to the site using www.example.com.
For example user lands on www.example.com, clicks on a link and the url becomes example.com/alias. For not so tech savvy users this is a big issue.
To sum it up - if www prefixing is enabled all links should use www prefix + domain name.
I realize there are two completely different issues here but they are related - finding one good solution will solve both
Comment #7
agentrickardThat logic seems totally backwards to me.
Non-tech savvy users don't even know how to read a URL host and generally don't care.
I still think this is a non-issue.
The message that users get is in response to #293453: Wildcard DNS - default domain, so you apparently have two groups of DA users asking for two different behaviors.
Comment #8
nonsieActually the message appears when at the server level www.example.com and example.com point to the same location yet only one (example.com without www prefixing or www.example.com) is defined in DA.
It would be nice if both example.com and www.example.com would work for the default domain without any messages.
Comment #9
panchoThe logic we're talking about is not backwards nor "naive", as you call it.
I strongly disagree with your argumentation. It's true that non-tech savvy users usually don't know the reasons why URLs are composed the way they are. But they do know how a URL usually looks like: http://www.example.com or http://foo.example.com. And it's exactly because they don't know the (in fact: non-existent) purpose of the "www" part, why they will get confused if something's different.
In print media (where there is no hyperlinks), the "www" part also serves as a signal word for "Look, this is an Internet address". If they would refer for example to "cocacola.eu", people wouldn't get that at first sight, as two words separated by a point is not specific enough to be interpreted as an Internet address.
But let's take a look at the results we want to have. See some examples:
Obviously all of these four global websites take care that their URL consists of exactly three parts: prefixed by a "www" for the main website - without the prefix for all subdomains.
That's exactly what I want and, if I got him right, that's also what nonsie wants. Not more nor less.
Why? Because it is the de facto Web standard. I would call this a valid use case.
Comment #10
agentrickardI like the samples in that last bit. So the issue is that our www prefix handling is universal when it should be selective?
Patches welcome. But perhaps the best fix for this is #284422: Subdomain Aliases. That patch would allow for multiple hosts to be assigned to the same domain, which is ideal.
One of the reasons I'm so testy lately is that no one seems to be testing patches, just complaining after features have been requested and committed.
And, for the record, the behavior that nonsie is describing is directly opposite the current (requested) behavior.
Comment #11
agentrickardVery tempting to mark this a duplicate of #284422: Subdomain Aliases.
Comment #12
pancho1.
Exactly. To allow for the behaviour we're asking for, all that needs to be done is what I proposed in my original issue:
2.
I can understand that very well. I don't have a test sandbox atm and will be away for two weeks, otherwise I would have given it a closer look to come up with a patch. Also, rather than blaming those who come up with new feature requests, I'd see it as an honour how people valuate the potential of your module. Without a question, it's gonna be one of the major, say "golden" modules, soon. It solves many needs webmasters have, and they want it to become even more powerful. The issue queue of edge-case modules looks different.
3.
#284422 will probably be a workaround, though I've not yet come to test it. To add "www.*" as a alias for every subdomain will be onerous, though. I'd rather get the original bug fixed.
Comment #13
agentrickardPatches welcome. But if you want maximum flexibility, then Domain Aliases is the way to go, and I am already committed to working that into the module.
And running the check first means that we would need to run two db queries each time (potentially), unless we ran something like:
Would that work, or cause problems if people register both www.example.com and example.com -- which your approach would also do, right?
Comment #14
agentrickardAnd in the case of the above fix, what do we do here?
Comment #15
agentrickardComment #16
nonsieJust to confirm - #12 would solve my problems with www prefix handling
Comment #17
panchoNow that we obviously agree that this should be fixed, it might be the best solution to wait until Ken has worked in the awesome Domain Aliases functionality. Then we can still decide on the best way to handle "www." prefixes, either leaving it separate or working it into Domain Aliases in some intelligent way!
Comment #18
agentrickard@nonsie -- you mean #13?
Well, thanks for the vote of confidence, but I am open to suggestion here. The problem is that other users asked for the reverse functionality earlier, so I do not have a good answer for the solution to this problem.
For now, you can obviously patch your installs as needed, but -- and Domain Alias is my preferred solution -- what options do we have?
The other option that I see is a per-domain setting for www aliasing, which is certainly possible.
Comment #19
nonsieThe ideal solution for me personally would be per-domain setting for www aliasing where if www alias is enabled it can be used throughout the site eg. if domain name is set to sub.example.com and it has an alias of www.sub.example.com users landing on www.sub.example.com will always see www prefixed domain name no matter where on the site they are (eg do not strip www for any url for the domain name if www aliasing is enabled for the domain name). It's those marketing people that apparently just can not live without www prefix:P
Haven't given Domain Alias a try yet (been too busy to get a site up and running) but I'll give it a try next week. It might provide me with a way to solve this issue however I'm a bit concerned about the extra queries that are required.
Comment #20
agentrickardIt's either going to be extra queries -- though I think the IN clause can handle that -- of an extra column in the database to store the prefix status.
Comment #21
agentrickardNote: The #284422: Subdomain Aliases patch just became critical, because it solves the dev -> staging -> live problem for the company I work for. For instance:
If you test the site at my.testexample.com but the live site is example.com, you have to change DA settings when moving the database from staging the live. Subdomain Aliases eliminates this issue by allowing you to register both names to the same domain id.
Comment #22
agentrickardAfter digging in, this is officialy a duplicate of #284422: Subdomain Aliases, which solves this problem very elegantly.
Comment #23
brianbrown commentedJust for the record (over a year later), the major browsers, i.e., Internet Explorer, Opera, Google Chrome, and the precious Firefox, will ALL attempt www.example.com if example.com does not resolve.
And, by the way, note how even the Drupal links autodiscovery in THIS VERY POST only converts links containing "www."
-B