WordPress.org

Make WordPress Core

Opened 7 years ago

Last modified 6 months ago

#6778 reopened enhancement

Detect when the config will cause infinite loop — at Version 19

Reported by: Analogpoint Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version: 2.5
Component: Permalinks Keywords: needs-patch dev-feedback
Focuses: Cc:

Description (last modified by westi)

Behavior:

If you put in http://www.domain.com in the "Wordpress Address" setting, then Wordpress will automatically do a redirect from http://domain.com to http://www.domain.com. Many hosting packages allow the user to deal with www and non-www versions of their domain. This will cause an infinite redirect loop if, for example, the "Wordpress Address" is set to http://www.domain.com and the hosting setting is set remove the www from the domain address-- to redirect http://www.domain.com to http://domain.com.

Expected behavior:

When setting the "Wordpress Address" setting, it should detect if the canocical code will cause an infinite redirect loop and warn/correct the mistake

Change History (22)

comment:1 @Viper007Bond7 years ago

  • Component changed from General to Administration

Yeah, wouldn't hurt to put a note there saying that the www/no-www preference will be enforced.

comment:2 @JohnLamansky7 years ago

  • Keywords 2nd-opinion added
  • Milestone changed from 2.7 to 2.5.2
  • Priority changed from normal to low
  • Summary changed from Redirect from domain.com to www.domain.com causes redirect loop to Add notice about www preference enforcement

comment:3 @thee177 years ago

  • Milestone changed from 2.5.2 to 2.7

comment:4 @caesarsgrunt7 years ago

Well actually, it's not just www/no-www, but it could do with a better explanation.

WordPress address (URL) is actually the absolute url to the directory in which the WordPress files live.

The value entered in the Blog address (URL) filed is the canonical url for the blog. Any other url pointing to WordPress install file, with any domain or subdomain, will be redirected to the value entered here.

@caesarsgrunt7 years ago

comment:5 @caesarsgrunt7 years ago

  • Keywords has-patch added

Here's a first try - someone else have a look and see if it's correct and clear enough!

comment:6 @Viper007Bond7 years ago

-1 to "unusual". Don't want to scare users off from that wonder, wonder feature (I do it on every single blog I install).

@caesarsgrunt7 years ago

comment:8 @Viper007Bond7 years ago

Yes, but more nitpicking:

  • I think "incorrectly" should be used instead of "wrongly" (is that even a word? not sure)
  • I think it should be "Other URLs pointing to your blog" to be clear what "it" is.

@caesarsgrunt7 years ago

comment:9 follow-up: @caesarsgrunt7 years ago

How's that then?

  • I've changed it to incorrectly - yes, wrongly is a word. It's in the Oxford American Dictionary on my Mac. I'm British, and I prefer wrongly to incorrectly, but I'm comfortable with either...
  • Yes, you're right of course. I've changed it to 'your blog'.

comment:10 @caesarsgrunt7 years ago

Of course actually, entering the wrong value in either filed will prevent access to the blog. But the description under the second one is already a bit long...

Another thought - what does anyone else think of the idea of moving the URL fields to the permalink page? (And possibly renaming the page...) I think that's a far more sensible place.

comment:11 in reply to: ↑ 9 ; follow-up: @Viper007Bond7 years ago

Replying to caesarsgrunt:

I'm British, and I prefer wrongly to incorrectly

Ah, I wasn't aware you Brits used "wrongly". Sounds very wrong to me being an American, no pun intended, heh.

comment:12 in reply to: ↑ 11 @caesarsgrunt7 years ago

Ah, but it's in the American dictionary! Mind you, so are wronger and wrongness, neither of which I'd dream of using... :)

Anyhow, I think incorrectly is fine.

comment:13 @matt6 years ago

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

I think this is not needed.

comment:14 @jacobsantos6 years ago

  • Keywords has-patch 2nd-opinion removed
  • Milestone 2.7 deleted

comment:15 @caesarsgrunt6 years ago

  • Keywords has-patch added
  • Milestone set to 2.7
  • Resolution wontfix deleted
  • Status changed from closed to reopened

@matt :
I think it is needed! :) Please reconsider...
So do other people, evidently, or the ticket wouldn't have been opened in the first place.

Anyhow; "Enter the address here if you want your blog homepage to be different from the directory you installed WordPress" is just plain bad English. The directory you installed WordPress? WTF???

comment:16 follow-up: @DD326 years ago

Alternate thought:

Use the HTTP API to request the new URL, and check to see if it gets redirected back to the current URL? (That'd require setting an extra param to tell the canonical redirection code from kicking in again possibly?)

But that's extra protection a different ticket might be better suited for, The actual "fault" in this ticket is really not an issue, People need to learn to enter the correct URL :) - But something does need to happen to stop the site from becoming completely unaccessable.

comment:17 in reply to: ↑ 16 @caesarsgrunt6 years ago

Replying to DD32:

Use the HTTP API to request the new URL, and check to see if it gets redirected back to the current URL? (That'd require setting an extra param to tell the canonical redirection code from kicking in again possibly?)

Yes, I like that idea. But as you say, it's a different ticket - the description needs clarifying as well.

Also, I can't see that getting into 2.7, whereas there's no reason why the string change shouldn't.

comment:18 @matt6 years ago

  • Milestone changed from 2.7 to 2.9

Removing from the 2.7 milestone, please do not add back. DD32's idea is cool.

comment:19 @westi6 years ago

  • Description modified (diff)
  • Keywords needs-patch added; has-patch removed
  • Priority changed from low to normal
  • Summary changed from Add notice about www preference enforcement to Detect when the config will cause infinite loop
Note: See TracTickets for help on using tickets.